Part Number Hot Search : 
3102A 2SC4450 DOC203 ICS830 M61541 AD7849 604BB LA35F
Product Description
Full Text Search
 

To Download DSPIC33FJ256GP510IPF-XXX Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? 2007 microchip technology inc. ds70286a dspic33fjxxxgpx06/x08/x10 data sheet high-performance, 16-bit digital signal controllers
ds70286a-page ii ? 2007 microchip technology inc. information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. it is your responsibility to ensure that your application meets with your specifications. microchip makes no representations or warranties of any kind whether express or implied, written or oral, statutory or otherwise, related to the information, including but not limited to its condition, quality, performance, merchantability or fitness for purpose . microchip disclaims all liability arising from this information and its use. use of microchip devices in life support and/or safety applications is entirely at the buyer?s risk, and the buyer agrees to defend, indemnify and hold harmless microchip from any and all damages, claims, suits, or expenses resulting from such use. no licenses are conveyed, implicitly or otherwise, under any microchip intellectual property rights. trademarks the microchip name and logo, the microchip logo, accuron, dspic, k ee l oq , k ee l oq logo, micro id , mplab, pic, picmicro, picstart, pro mate, rfpic and smartshunt are registered trademarks of micr ochip technology incorporated in the u.s.a. and other countries. amplab, filterlab, linear active thermistor, migratable memory, mxdev, mxlab, seeval, smartsensor and the embedded control solutions company are registered trademarks of microchip tec hnology incorporated in the u.s.a. analog-for-the-digital age, appl ication maestro, codeguard, dspicdem, dspicdem.net, dspicworks, ecan, economonitor, fansense, flexrom, fuzzylab, in-circuit serial programming, icsp, icepic, mindi, miwi, mpasm, mplab certified logo, mplib, mplink, pickit, picdem, picdem.net, piclab, pictail, powercal, powerinfo, powermate, powertool, real ice, rflab, select mode, smart serial, smarttel, total endurance, uni/o, wiperlock and zena are tr ademarks of microchip technology incorporated in the u.s.a. and other countries. sqtp is a service mark of microchip technology incorporated in the u.s.a. all other trademarks mentioned herein are property of their respective companies. ? 2007, microchip technology incorporated, printed in the u.s.a., all rights reserved. printed on recycled paper. note the following details of the code protection feature on microchip devices: ? microchip products meet the specification cont ained in their particular microchip data sheet. ? microchip believes that its family of products is one of the mo st secure families of its kind on the market today, when used i n the intended manner and under normal conditions. ? there are dishonest and possibly illegal methods used to breach the code protection feature. all of these methods, to our knowledge, require using the microchip produc ts in a manner outside the operating specifications contained in microchip?s data sheets. most likely, the person doing so is engaged in theft of intellectual property. ? microchip is willing to work with the customer who is concerned about the integrity of their code. ? neither microchip nor any other semiconductor manufacturer c an guarantee the security of their code. code protection does not mean that we are guaranteeing the product as ?unbreakable.? code protection is constantly evolving. we at microchip are co mmitted to continuously improvi ng the code protection features of our products. attempts to break microchip?s c ode protection feature may be a violation of the digital millennium copyright act. if such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that act. microchip received iso/ts-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in chandler and tempe, arizona; gresham, oregon and design centers in california and india. the company?s quality system processes and procedures are for its pic ? mcus and dspic ? dscs, k ee l oq ? code hopping devices, serial eeproms, microperipherals, nonvolatile memory and analog products. in addition, microchip?s quality system for the design and manufacture of development systems is iso 9001:2000 certified.
? 2007 microchip technology inc. ds70286a-page 1 dspic33fjxxxgpx06/x08/x10 operating range: ? dc ? 40 mips (40 mips @ 3.0-3.6v, -40c to +85c) ? industrial temperature range (-40c to +85c) high-performance dsc cpu: ? modified harvard architecture ? c compiler optimized instruction set ? 16-bit wide data path ? 24-bit wide instructions ? linear program memory addressing up to 4m instruction words ? linear data memory addressing up to 64 kbytes ? 83 base instructions: mostly 1 word/1 cycle ? sixteen 16-bit general purpose registers ? two 40-bit accumulators: - with rounding and saturation options ? flexible and powerful addressing modes: - indirect, modulo and bit-reversed ? software stack ? 16 x 16 fractional/integer multiply operations ? 32/16 and 16/16 divide operations ? single-cycle multiply and accumulate: - accumulator write back for dsp operations - dual data fetch ? up to 16-bit shifts for up to 40-bit data direct memory access (dma): ? 8-channel hardware dma: ? 2 kbytes dual ported dma buffer area (dma ram) to store data transferred via dma: - allows data transfer between ram and a peripheral while cpu is executing code (no cycle stealing) ? most peripherals support dma interrupt controller: ? 5-cycle latency ? 118 interrupt vectors ? up to 63 available interrupt sources ? up to 5 external interrupts ? 7 programmable priority levels ? 5 processor exceptions digital i/o: ? up to 85 programmable digital i/o pins ? wake-up/interrupt-on-change on up to 24 pins ? output pins can drive from 3.0v to 3.6v ? all digital input pins are 5v tolerant ? 4 ma sink on all i/o pins on-chip flash and sram: ? flash program memory, up to 256 kbytes ? data sram, up to 30 kbytes (includes 2 kbytes of dma ram): system management: ? flexible clock options: - external, crystal, resonator, internal rc - fully integrated pll - extremely low jitter pll ? power-up timer ? oscillator start-up timer/stabilizer ? watchdog timer with its own rc oscillator ? fail-safe clock monitor ? reset by multiple sources power management: ? on-chip 2.5v voltage regulator ? switch between clock sources in real time ? idle, sleep and doze modes with fast wake-up timers/capture/compare/pwm: ? timer/counters, up to nine 16-bit timers: - can pair up to make four 32-bit timers - 1 timer runs as real-time clock with external 32.768 khz oscillator - programmable prescaler ? input capture (up to 8 channels): - capture on up, down or both edges - 16-bit capture input functions - 4-deep fifo on each capture ? output compare (up to 8 channels): - single or dual 16-bit compare mode - 16-bit glitchless pwm mode high-performance, 16-bit di gital signal controllers
dspic33fjxxxgpx06/x08/x10 ds70286a-page 2 ? 2007 microchip technology inc. communication modules: ? 3-wire spi (up to 2 modules): - framing supports i/o interface to simple codecs - supports 8-bit and 16-bit data - supports all serial clock formats and sampling modes ?i 2 c? (up to 2 modules): - full multi-master slave mode support - 7-bit and 10-bit addressing - bus collision detection and arbitration - integrated signal conditioning - slave address masking ? uart (up to 2 modules): - interrupt on address bit detect - interrupt on uart error - wake-up on start bit from sleep mode - 4-character tx and rx fifo buffers - lin bus support -irda ? encoding and decoding in hardware - high-speed baud mode - hardware flow control with cts and rts ? data converter interface (dci) module: - codec interface - supports i 2 s and ac?97 protocols - up to 16-bit data words, up to 16 words per frame - 4-word deep tx and rx buffers ? enhanced can (ecan? module) 2.0b active (up to 2 modules): - up to 8 transmit and up to 32 receive buffers - 16 receive filters and 3 masks - loopback, listen only and listen all messages modes for diagnostics and bus monitoring - wake-up on can message - automatic processing of remote transmission requests - fifo mode using dma - devicenet? addressing support analog-to-digital converters (adcs): ? up to two adc modules in a device ? 10-bit, 1.1 msps or 12-bit, 500 ksps conversion: - 2, 4 or 8 simultaneous samples - up to 32 input channels with auto-scanning - conversion start can be manual or synchronized with 1 of 4 trigger sources - conversion possible in sleep mode - 1 lsb max integral nonlinearity - 1 lsb max differential nonlinearity cmos flash technology: ? low-power, high-speed flash technology ? fully static design ? 3.3v (10%) operating voltage ? industrial temperature ? low-power consumption packaging: ? 100-pin tqfp (14x14x1 mm and 12x12x1 mm) ? 80-pin tqfp (12x12x1 mm) ? 64-pin tqfp (10x10x1 mm) note: see the device variant tables for exact peripheral features per device.
? 2007 microchip technology inc. ds70286a-page 3 dspic33fjxxxgpx06/x08/x10 dspic33f product families there is a subfamily within the dspic33f family of devices which is the general purpose family that is ideal for a wide variety of 16-bit mcu embedded applications. the variants with codec interfaces are well-suited for speech and audio processing applications. the device names, pin counts, memory sizes and peripheral availability of each family are listed below, followed by their pinout diagrams. dspic33f general purpose family variants device pins program flash memory (kbyte) ram (kbyte) (1) 16-bit timer input capture output compare std. pwm codec interface adc uart spi i 2 c? enhanced can i/o pins (max) (2) packages dspic33fj64gp206 64 64 8 9 8 8 1 1 adc, 18 ch 221 053 pt dspic33fj64gp306 64 64 16 9 8 8 1 1 adc, 18 ch 222 053 pt dspic33fj64gp310 100 64 16 9 8 8 1 1 adc, 32 ch 222 085pf, pt dspic33fj64gp706 64 64 16 9 8 8 1 2 adc, 18 ch 222 253 pt dspic33fj64gp708 80 64 16 9 8 8 1 2 adc, 24 ch 222 269 pt dspic33fj64gp710 100 64 16 9 8 8 1 2 adc, 32 ch 222 285pf, pt dspic33fj128gp206 64 128 8 9 8 8 1 1 adc, 18 ch 221 053 pt dspic33fj128gp306 64 128 16 9 8 8 1 1 adc, 18 ch 222 053 pt dspic33fj128gp310 100 128 16 9 8 8 1 1 adc, 32 ch 222 085pf, pt dspic33fj128gp706 64 128 16 9 8 8 1 2 adc, 18 ch 222 253 pt dspic33fj128gp708 80 128 16 9 8 8 1 2 adc, 24 ch 222 269 pt dspic33fj128gp710 100 128 16 9 8 8 1 2 adc, 32 ch 222 285pf, pt dspic33fj256gp506 64 256 16 9 8 8 1 1 adc, 18 ch 222 153 pt dspic33fj256gp510 100 256 16 9 8 8 1 1 adc, 32 ch 222 185pf, pt dspic33fj256gp710 100 256 30 9 8 8 1 2 adc, 32 ch 222 285pf, pt note 1: ram size is inclusive of 2 kbytes dma ram. 2: maximum i/o pin count includes pins shared by the per ipheral functions.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 4 ? 2007 microchip technology inc. pin diagrams 64-pin tqfp 1 2 3 4 5 6 7 8 9 10 11 12 13 36 35 34 33 32 31 30 29 28 27 26 64 63 62 61 60 59 58 57 56 14 15 16 17 18 19 20 21 22 23 24 25 pgc2/emuc2/sosco/t1ck/cn0/rc14 pgd2/emud2/sosci/t4ck/cn1/rc13 oc1/rd0 ic4/int4/rd11 ic2/u1cts /int2/rd9 ic1/int1/rd8 v ss osc2/clko/rc15 osc1/clkin/rc12 v dd scl1/rg2 u1rts /sck1/int0/rf6 u1rx/sdi1/rf2 u1tx/sdo1/rf3 cofs/rg15 an16/t2ck/t7ck/rc1 an17/t3ck/t6ck/rc2 sck2/cn8/rg6 sdi2/cn9/rg7 sdo2/cn10/rg8 mclr v ss v dd an3/cn5/rb3 an2/ss1 /cn4/rb2 pgc3/emuc3/an1/v ref -/cn3/rb1 pgd3/emud3/an0/v ref +/cn2/rb0 oc8/cn16/rd7 csdo/rg13 csdi/rg12 csck/rg14 v ddcore rg1 rf1 rg0 oc2/rd1 oc3/rd2 pgc1/emuc1/an6/ocfa/rb6 pgd1/emud1/an7/rb7 av dd av ss u2cts /an8/rb8 an9/rb9 tms/an10/rb10 tdo/an11/rb11 v ss v dd tck/an12/rb12 tdi/an13/rb13 u2rts /an14/rb14 an15/ocfb/cn12/rb15 u2tx/cn18/rf5 u2rx / cn17/rf4 sda1/rg3 43 42 41 40 39 38 37 44 48 47 46 50 49 51 54 53 52 55 45 ss2 /cn11/rg9 an5/ic8/cn7/rb5 an4/ic7/cn6/rb4 ic3/int3/rd10 v dd rf0 oc4/rd3 oc7/cn15/rd6 oc6/ic6/cn14/rd5 oc5/ic5/cn13/rd4 dspic33fj64gp206 dspic33fj128gp206
? 2007 microchip technology inc. ds70286a-page 5 dspic33fjxxxgpx06/x08/x10 pin diagrams (continued) 64-pin tqfp 1 2 3 4 5 6 7 8 9 10 11 12 13 36 35 34 33 32 31 30 29 28 27 26 64 63 62 61 60 59 58 57 56 14 15 16 17 18 19 20 21 22 23 24 25 pgc2/emuc2/sosco/t1ck/cn0/rc14 pgd2/emud2/sosci/t4ck/cn1/rc13 oc1/rd0 ic4/int4/rd11 ic2/u1cts /int2/rd9 ic1/int1/rd8 v ss osc2/clko/rc15 osc1/clkin/rc12 v dd scl1/rg2 u1rts /sck1/int0/rf6 u1rx/sdi1/rf2 u1tx/sdo1/rf3 cofs/rg15 an16/t2ck/t7ck/rc1 an17/t3ck/t6ck/rc2 sck2/cn8/rg6 sdi2/cn9/rg7 sdo2/cn10/rg8 mclr v ss v dd an3/cn5/rb3 an2/ss1 /cn4/rb2 pgc3/emuc3/an1/v ref -/cn3/rb1 pgd3/emud3/an0/v ref +/cn2/rb0 oc8/cn16/rd7 csdo/rg13 csdi/rg12 csck/rg14 v ddcore rg1 rf1 rg0 oc2/rd1 oc3/rd2 pgc1/emuc1/an6/ocfa/rb6 pgd1/emud1/an7/rb7 av dd av ss u2cts /an8/rb8 an9/rb9 tms/an10/rb10 tdo/an11/rb11 v ss v dd tck/an12/rb12 tdi/an13/rb13 u2rts /an14/rb14 an15/ocfb/cn12/rb15 u2tx/scl2/cn18/rf5 u2rx / sda2/cn17/rf4 sda1/rg3 43 42 41 40 39 38 37 44 48 47 46 50 49 51 54 53 52 55 45 ss2 /cn11/rg9 an5/ic8/cn7/rb5 an4/ic7/cn6/rb4 ic3/int3/rd10 v dd rf0 oc4/rd3 oc7/cn15/rd6 oc6/ic6/cn14/rd5 oc5/ic5/cn13/rd4 dspic33fj64gp306 dspic33fj128gp306
dspic33fjxxxgpx06/x08/x10 ds70286a-page 6 ? 2007 microchip technology inc. pin diagrams (continued) 64-pin tqfp 1 2 3 4 5 6 7 8 9 10 11 12 13 36 35 34 33 32 31 30 29 28 27 26 64 63 62 61 60 59 58 57 56 14 15 16 17 18 19 20 21 22 23 24 25 pgc2/emuc2/sosco/t1ck/cn0/rc14 pgd2/emud2/sosci/t4ck/cn1/rc13 oc1/rd0 ic4/int4/rd11 ic2/u1cts /int2/rd9 ic1/int1/rd8 v ss osc2/clko/rc15 osc1/clkin/rc12 v dd scl1/rg2 u1rts /sck1/int0/rf6 u1rx/sdi1/rf2 u1tx/sdo1/rf3 cofs/rg15 an16/t2ck/t7ck/rc1 an17/t3ck/t6ck/rc2 sck2/cn8/rg6 sdi2/cn9/rg7 sdo2/cn10/rg8 mclr v ss v dd an3/cn5/rb3 an2/ss1 /cn4/rb2 pgc3/emuc3/an1/v ref -/cn3/rb1 pgd3/emud3/an0/v ref +/cn2/rb0 oc8/cn16/rd7 csdo/rg13 csdi/rg12 csck/rg14 v ddcore rg1 c1tx/rf1 rg0 oc2/rd1 oc3/rd2 pgc1/emuc1/an6/ocfa/rb6 pgd1/emud1/an7/rb7 av dd av ss u2cts /an8/rb8 an9/rb9 tms/an10/rb10 tdo/an11/rb11 v ss v dd tck/an12/rb12 tdi/an13/rb13 u2rts /an14/rb14 an15/ocfb/cn12/rb15 u2tx/scl2/cn18/rf5 u2rx / sda2/cn17/rf4 sda1/rg3 43 42 41 40 39 38 37 44 48 47 46 50 49 51 54 53 52 55 45 ss2 /cn11/rg9 an5/ic8/cn7/rb5 an4/ic7/cn6/rb4 ic3/int3/rd10 v dd c1rx/rf0 oc4/rd3 oc7/cn15/rd6 oc6/ic6/cn14/rd5 oc5/ic5/cn13/rd4 dspic33fj256gp506
? 2007 microchip technology inc. ds70286a-page 7 dspic33fjxxxgpx06/x08/x10 pin diagrams (continued) 64-pin tqfp 1 2 3 4 5 6 7 8 9 10 11 12 13 36 35 34 33 32 31 30 29 28 27 26 64 63 62 61 60 59 58 57 56 14 15 16 17 18 19 20 21 22 23 24 25 pgc2/emuc2/sosco/t1ck/cn0/rc14 pgd2/emud2/sosci/t4ck/cn1/rc13 oc1/rd0 ic4/int4/rd11 ic2/u1cts /int2/rd9 ic1/int1/rd8 v ss osc2/clko/rc15 osc1/clkin/rc12 v dd scl1/rg2 u1rts /sck1/int0/rf6 u1rx/sdi1/rf2 u1tx/sdo1/rf3 cofs/rg15 an16/t2ck/t7ck/rc1 an17/t3ck/t6ck/rc2 sck2/cn8/rg6 sdi2/cn9/rg7 sdo2/cn10/rg8 mclr v ss v dd an3/cn5/rb3 an2/ss1 /cn4/rb2 pgc3/emuc3/an1/v ref -/cn3/rb1 pgd3/emud3/an0/v ref +/cn2/rb0 oc8/cn16/rd7 csdo/rg13 csdi/rg12 csck/rg14 v ddcore c2tx/rg1 c1tx/rf1 c2rx/rg0 oc2/rd1 oc3/rd2 pgc1/emuc1/an6/ocfa/rb6 pgd1/emud1/an7/rb7 av dd av ss u2cts /an8/rb8 an9/rb9 tms/an10/rb10 tdo/an11/rb11 v ss v dd tck/an12/rb12 tdi/an13/rb13 u2rts /an14/rb14 an15/ocfb/cn12/rb15 u2tx/scl2/cn18/rf5 u2rx / sda2/cn17/rf4 sda1/rg3 43 42 41 40 39 38 37 44 48 47 46 50 49 51 54 53 52 55 45 ss2 /cn11/rg9 an5/ic8/cn7/rb5 an4/ic7/cn6/rb4 ic3/int3/rd10 v dd c1rx/rf0 oc4/rd3 oc7/cn15/rd6 oc6/ic6/cn14/rd5 oc5/ic5/cn13/rd4 dspic33fj64gp706 dspic33fj128gp706
dspic33fjxxxgpx06/x08/x10 ds70286a-page 8 ? 2007 microchip technology inc. pin diagrams (continued) 80-pin tqfp 72 74 73 71 70 69 68 67 66 65 64 63 62 61 20 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 50 49 48 47 46 45 44 21 41 40 39 38 37 36 35 34 23 24 25 26 27 28 29 30 31 32 33 dspic33fj64gp708 17 18 19 75 1 57 56 55 54 53 52 51 60 59 58 43 42 76 78 77 79 22 80 ic5/rd12 oc4/rd3 oc3/rd2 oc2/rd1 csck/rg14 an23/cn23/ra7 an22/cn22/ra6 c2rx/rg0 c2tx/rg1 c1tx/rf1 c1rx/rf0 csdo/rg13 csdi/rg12 oc8/cn16/rd7 oc6/cn14/rd5 oc1/rd0 ic4/rd11 ic2/rd9 ic1/rd8 ic3/rd10 v ss osc1/clkin/rc12 v dd scl1/rg2 u1rx/rf2 u1tx/rf3 pgc2/emuc2/sosco/t1ck/cn0/rc14 pgd2/emud2/sosci/cn1/rc13 v ref +/ra10 v ref -/ra9 av dd av ss u2cts /an8/rb8 an9/rb9 an10/rb10 an11/rb11 v dd u2rx/cn17/rf4 ic8/u1rts /cn21/rd15 u2tx/cn18/rf5 pgc1/emuc1/an6/ocfa/rb6 pgd1/emud1/an7/rb7 an17/t3ck/t6ck/rc2 an18/t4ck/t9ck/rc3 an19/t5ck/t8ck/rc4 sck2/cn8/rg6 sdi2/cn9/rg7 sdo2/cn10/rg8 mclr ss2 /cn11/rg9 an4/cn6/rb4 an3/cn5/rb3 an2/ss1 /cn4/rb2 pgc3/emuc3/an1/cn3/rb1 pgd3/emud3/an0/cn2/rb0 v ss v dd cofs/rg15 an16/t2ck/t7ck/rc1 tdo/an21/int2/ra13 tms/an20/int1/ra12 tck/an12/rb12 tdi/an13/rb13 u2rts /an14/rb14 an15/ocfb/cn12/rb15 v dd v ddcore oc5/cn13/rd4 ic6/cn19/rd13 sda1/rg3 sdi1/rf7 sdo1/rf8 an5/cn7/rb5 v ss osc2/clko/rc15 oc7/cn15/rd6 sck1/int0/rf6 ic7/u1cts /cn20/rd14 sda2/int4/ra3 scl2/int3/ra2 dspic33fj128gp708
? 2007 microchip technology inc. ds70286a-page 9 dspic33fjxxxgpx06/x08/x10 pin diagrams (continued) 92 94 93 91 90 89 88 87 86 85 84 83 82 81 80 79 78 20 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 65 64 63 62 61 60 59 26 56 45 44 43 42 41 40 39 28 29 30 31 32 33 34 35 36 37 38 17 18 19 21 22 95 1 76 77 72 71 70 69 68 67 66 75 74 73 58 57 24 23 25 96 98 97 99 27 46 47 48 49 50 55 54 53 52 51 oc6/cn14/rd5 oc5/cn13/rd4 ic6/cn19/rd13 ic5/rd12 oc4/rd3 oc3/rd2 oc2/rd1 an23/cn23/ra7 an22/cn22/ra6 an26/re2 csdo/rg13 csdi/rg12 csck/rg14 an25/re1 an24/re0 rg0 an28/re4 an27/re3 rf0 v ddcore pgd2/emud2/sosci/cn1/rc13 oc1/rd0 ic3/rd10 ic2/rd9 ic1/rd8 ic4/rd11 sda2/ra3 scl2/ra2 osc2/clko/rc15 osc1/clkin/rc12 v dd scl1/rg2 sck1/int0/rf6 sdi1/rf7 sdo1/rf8 sda1/rg3 u1rx/rf2 u1tx/rf3 v ss pgc2/emuc2/sosco/t1ck/cn0/rc14 v ref +/ra10 v ref -/ra9 av dd av ss an8/rb8 an9/rb9 an10/rb10 an11/rb11 v dd u2cts /rf12 u2rts /rf13 ic7/u1cts /cn20/rd14 ic8/u1rts /cn21/rd15 v dd v ss pgc1/emuc1/an6/ocfa/rb6 pgd1/emud1/an7/rb7 u2tx/cn18/rf5 u2rx/cn17/rf4 an29/re5 an30/re6 an31/re7 an16/t2ck/t7ck/rc1 an17/t3ck/t6ck/rc2 an18/t4ck/t9ck/rc3 an19/t5ck/t8ck/rc4 sck2/cn8/rg6 v dd tms/ra0 an20/int1/ra12 an21/int2/ra13 an5/cn7/rb5 an4/cn6/rb4 an3/cn5/rb3 an2/ss1 /cn4/rb2 sdi2/cn9/rg7 sdo2/cn10/rg8 pgc3/emuc3/an1/cn3/rb1 pgd3/emud3/an0/cn2/rb0 cofs/rg15 v dd ss2 /cn11/rg9 mclr an12/rb12 an13/rb13 an14/rb14 an15/ocfb/cn12/rb15 rg1 rf1 oc8/cn16/rd7 oc7/cn15/rd6 tdo/ra5 int4/ra15 int3/ra14 v ss v ss v ss v dd tdi/ra4 tck/ra1 100-pin tqfp dspic33fj64gp310 dspic33fj128gp310 100
dspic33fjxxxgpx06/x08/x10 ds70286a-page 10 ? 2007 microchip technology inc. pin diagrams (continued) 92 94 93 91 90 89 88 87 86 85 84 83 82 81 80 79 78 20 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 65 64 63 62 61 60 59 26 56 45 44 43 42 41 40 39 28 29 30 31 32 33 34 35 36 37 38 17 18 19 21 22 95 1 76 77 72 71 70 69 68 67 66 75 74 73 58 57 24 23 25 96 98 97 99 27 46 47 48 49 50 55 54 53 52 51 oc6/cn14/rd5 oc5/cn13/rd4 ic6/cn19/rd13 ic5/rd12 oc4/rd3 oc3/rd2 oc2/rd1 an23/cn23/ra7 an22/cn22/ra6 an26/re2 csdo/rg13 csdi/rg12 csck/rg14 an25/re1 an24/re0 rg0 an28/re4 an27/re3 c1rx/rf0 v ddcore pgd2/emud2/sosci/cn1/rc13 oc1/rd0 ic3/rd10 ic2/rd9 ic1/rd8 ic4/rd11 sda2/ra3 scl2/ra2 osc2/clko/rc15 osc1/clkin/rc12 v dd scl1/rg2 sck1/int0/rf6 sdi1/rf7 sdo1/rf8 sda1/rg3 u1rx/rf2 u1tx/rf3 v ss pgc2/emuc2/sosco/t1ck/cn0/rc14 v ref +/ra10 v ref -/ra9 av dd av ss an8/rb8 an9/rb9 an10/rb10 an11/rb11 v dd u2cts /rf12 u2rts /rf13 ic7/u1cts /cn20/rd14 ic8/u1rts /cn21/rd15 v dd v ss pgc1/emuc1/an6/ocfa/rb6 pgd1/emud1/an7/rb7 u2tx/cn18/rf5 u2rx/cn17/rf4 an29/re5 an30/re6 an31/re7 an16/t2ck/t7ck/rc1 an17/t3ck/t6ck/rc2 an18/t4ck/t9ck/rc3 an19/t5ck/t8ck/rc4 sck2/cn8/rg6 v dd tms/ra0 an20/int1/ra12 an21/int2/ra13 an5/cn7/rb5 an4/cn6/rb4 an3/cn5/rb3 an2/ss1 /cn4/rb2 sdi2/cn9/rg7 sdo2/cn10/rg8 pgc3/emuc3/an1/cn3/rb1 pgd3/emud3/an0/cn2/rb0 cofs/rg15 v dd ss2 /cn11/rg9 mclr an12/rb12 an13/rb13 an14/rb14 an15/ocfb/cn12/rb15 rg1 c1tx/rf1 oc8/cn16/rd7 oc7/cn15/rd6 tdo/ra5 int4/ra15 int3/ra14 v ss v ss v ss v dd tdi/ra4 tck/ra1 100-pin tqfp dspic33fj256gp510 100
? 2007 microchip technology inc. ds70286a-page 11 dspic33fjxxxgpx06/x08/x10 pin diagrams (continued) 92 94 93 91 90 89 88 87 86 85 84 83 82 81 80 79 78 20 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 65 64 63 62 61 60 59 26 56 45 44 43 42 41 40 39 28 29 30 31 32 33 34 35 36 37 38 17 18 19 21 22 95 1 76 77 72 71 70 69 68 67 66 75 74 73 58 57 24 23 25 96 98 97 99 27 46 47 48 49 50 55 54 53 52 51 oc6/cn14/rd5 oc5/cn13/rd4 ic6/cn19/rd13 ic5/rd12 oc4/rd3 oc3/rd2 oc2/rd1 an23/cn23/ra7 an22/cn22/ra6 an26/re2 csdo/rg13 csdi/rg12 csck/rg14 an25/re1 an24/re0 c2rx/rg0 an28/re4 an27/re3 c1rx/rf0 v ddcore pgd2/emud2/sosci/cn1/rc13 oc1/rd0 ic3/rd10 ic2/rd9 ic1/rd8 ic4/rd11 sda2/ra3 scl2/ra2 osc2/clko/rc15 osc1/clkin/rc12 v dd scl1/rg2 sck1/int0/rf6 sdi1/rf7 sdo1/rf8 sda1/rg3 u1rx/rf2 u1tx/rf3 v ss pgc2/emuc2/sosco/t1ck/cn0/rc14 v ref +/ra10 v ref -/ra9 av dd av ss an8/rb8 an9/rb9 an10/rb10 an11/rb11 v dd u2cts /rf12 u2rts /rf13 ic7/u1cts /cn20/rd14 ic8/u1rts /cn21/rd15 v dd v ss pgc1/emuc1/an6/ocfa/rb6 pgd1/emud1/an7/rb7 u2tx/cn18/rf5 u2rx/cn17/rf4 an29/re5 an30/re6 an31/re7 an16/t2ck/t7ck/rc1 an17/t3ck/t6ck/rc2 an18/t4ck/t9ck/rc3 an19/t5ck/t8ck/rc4 sck2/cn8/rg6 v dd tms/ra0 an20/int1/ra12 an21/int2/ra13 an5/cn7/rb5 an4/cn6/rb4 an3/cn5/rb3 an2/ss1 /cn4/rb2 sdi2/cn9/rg7 sdo2/cn10/rg8 pgc3/emuc3/an1/cn3/rb1 pgd3/emud3/an0/cn2/rb0 cofs/rg15 v dd ss2 /cn11/rg9 mclr an12/rb12 an13/rb13 an14/rb14 an15/ocfb/cn12/rb15 c2tx/rg1 c1tx/rf1 oc8/cn16/rd7 oc7/cn15/rd6 tdo/ra5 int4/ra15 int3/ra14 v ss v ss v ss v dd tdi/ra4 tck/ra1 100-pin tqfp dspic33fj128gp710 100 dspic33fj256gp710 dspic33fj64gp710
dspic33fjxxxgpx06/x08/x10 ds70286a-page 12 ? 2007 microchip technology inc. table of contents dspic33f product families ...................................................................................................... ............................................................. 3 1.0 device overview ............................................................................................................. ........................................................... 13 2.0 cpu ......................................................................................................................... ................................................................... 17 3.0 memory organization ......................................................................................................... ........................................................ 29 4.0 flash program memory........................................................................................................ ...................................................... 67 5.0 resets ..................................................................................................................... .................................................................. 73 6.0 interrupt controller ........................................................................................................ ............................................................. 79 7.0 direct memory access (dma) .................................................................................................. ................................................ 125 8.0 oscillator configuration ...................................... .............................................................. ........................................................ 135 9.0 power-saving features....................................................................................................... ..................................................... 143 10.0 i/o ports .................................................................................................................. ................................................................. 145 11.0 timer1 ..................................................................................................................... ................................................................. 147 12.0 timer2/3, timer4/5, timer6/7 and timer8/9 ................................................................................. ........................................... 149 13.0 input capture.............................................................................................................. .............................................................. 155 14.0 output compare ............................................................................................................. .......................................................... 157 15.0 serial peripheral interface (spi).......................................................................................... ..................................................... 161 16.0 inter-integrated circuit (i 2 c) ............................................................................................................................. ........................ 169 17.0 universal asynchronous receiver transmitter (uart) ......................................................................... .................................. 179 18.0 enhanced can (ecan?) module ................................................................................................ ........................................... 187 19.0 data converter interface (dci) module...................................................................................... .............................................. 217 20.0 10-bit/12-bit analog-to-digital converter (adc) ............................................................................ ........................................... 231 21.0 special features ........................................................................................................... ........................................................... 245 22.0 instruction set summary .................................................................................................... ...................................................... 253 23.0 development support........................................................................................................ ....................................................... 261 24.0 electrical characteristics ................................................................................................. ......................................................... 265 25.0 packaging information...................................................................................................... ........................................................ 303 appendix a: differences between ?ps? (prototype sample) devices and final production devices................................... ............. 309 appendix b: revision history................................................................................................... .......................................................... 310 index .......................................................................................................................... ....................................................................... 311 the microchip web site ......................................................................................................... ............................................................ 317 customer change notification service ........................................................................................... ................................................... 317 customer support ............................................................................................................... ............................................................... 317 reader response ................................................................................................................ .............................................................. 318 product identification system...... ............................................................................................ ...........................................................319 to our valued customers it is our intention to provide our valued customers with the be st documentation possible to ensure successful use of your micro chip products. to this end, we will continue to improve our publications to better suit your needs. our publications will be refined and enhanced as new volumes and updates are introduced. if you have any questions or comments regardi ng this publication, please contact the marketing communications department via e-mail at docerrors@microchip.com or fax the reader response form in the back of this data sheet to (480) 792-4150. we welcome your feedback. most current data sheet to obtain the most up-to-date version of this data s heet, please register at our worldwide web site at: http://www.microchip.com you can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page . the last character of the literature number is the vers ion number, (e.g., ds30000a is version a of document ds30000). errata an errata sheet, describing minor operational differences fr om the data sheet and recommended workarounds, may exist for curren t devices. as device/documentation issues become known to us, we will publish an errata sheet. the errata will specify the revisi on of silicon and revision of document to which it applies. to determine if an errata sheet exists for a particular device, please check with one of the following: ? microchip?s worldwide web site; http://www.microchip.com ? your local microchip sales office (see last page) when contacting a sales office, please specify which device, re vision of silicon and data sheet (include literature number) you are using. customer notification system register on our web site at www.microchip.com to receive the most current information on all of our products.
? 2007 microchip technology inc. ds70286a-page 13 dspic33fjxxxgpx06/x08/x10 1.0 device overview this document contains device specific information for the following devices: ? dspic33fj64gp206 ? dspic33fj64gp306 ? dspic33fj64gp310 ? dspic33fj64gp706 ? dspic33fj64gp708 ? dspic33fj64gp710 ? dspic33fj128gp206 ? dspic33fj128gp306 ? dspic33fj128gp310 ? dspic33fj128gp706 ? dspic33fj128gp708 ? dspic33fj128gp710 ? dspic33fj256gp506 ? dspic33fj256gp510 ? dspic33fj256gp710 the dspic33fjxxxgpx06/x08/x10 general purpose family of device include devices with a wide range of pin counts (64, 80 and 100), different program memory sizes (64 kbytes, 128 kbytes and 256 kbytes) and dif- ferent ram sizes (8 kbytes, 16 kbytes and 30 kbytes) this makes this family suitable for a wide variety of high-performance digital signal control applications. the device is pin compatible with the pic24h family of devices, and also share a very high degree of compatibility with the dspic30f family devices. this allows for easy migration between device families as may be necessitated by the specific functionality, computa- tional resource and system cost requirements of the application. the dspic33fjxxxgpx06/x08/x10 device family employs a powerful 16-bit architecture that seamlessly integrates the control features of a microcontroller (mcu) with the computational capabilities of a digital signal processor (dsp). the resulting functionality is ideal for applications that rely on high-speed, repetitive computations, as well as control. the dsp engine, dual 40-bit accumulators, hardware support for division operations, barrel shifter, 17 x 17 multiplier, a large array of 16-bit working registers and a wide variety of data addressing modes, together provide the dspic33fjxxxgpx06/x08/x10 central processing unit (cpu) with extensive mathematical processing capability. flexible and deterministic interrupt handling, coupled with a powerful array of peripherals, renders the dspic33fjxxxgpx06/x08/x10 devices suitable for control applications. further, direct memory access (dma) enables overhead-free transfer of data between several peripherals and a dedicated dma ram. reliable, field programmable flash program memory ensures scalability of applications that use dspic33fjxxxgpx06/x08/x10 devices. figure 1-1 shows a general block diagram of the various core and peripheral modules in the dspic33fjxxxgpx06/x08/x10 family of devices. table 1-1 lists the functions of the various pins shown in the pinout diagrams. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 14 ? 2007 microchip technology inc. figure 1-1: dspic33fjxxxgpx06/ x08/x10 general block diagram 16 osc1/clki osc2/clko v dd , v ss timing generation mclr power-up timer oscillator start-up timer power-on reset watchdog timer brown-out reset precision reference band gap frc/lprc oscillators regulator voltage v ddcore /v cap uart1,2 ecan1,2 dci ic1-8 spi1,2 i2c1,2 oc/ porta note: not all pins or features are implement ed on all device pinout configurations. see pinout diagrams for the specific pins and features present on each device. pwm1-8 cn1-23 instruction decode & control pch pcl 16 program counter 16-bit alu 23 23 24 23 instruction reg pcu 16 x 16 w register array rom latch 16 ea mux 16 16 8 interrupt controller psv & table data access control block stack control logic loop control logic data latch address latch address latch program memory data latch address bus literal data 16 16 16 16 data latch address latch 16 x ram y ram 16 y data bus x data bus dsp engine divide support 16 dma ram dma controller control signals to various blocks adc1,2 timers portb portc portd porte portf portg address generator units 1-9
? 2007 microchip technology inc. ds70286a-page 15 dspic33fjxxxgpx06/x08/x10 table 1-1: pinout i/o descriptions pin name pin type buffer type description an0-an31 i analog analog input channels. av dd p p positive supply for analog modules. av ss p p ground reference for analog modules. clki clko i o st/cmos ? external clock source input. always associated with osc1 pin function. oscillator crystal output. connects to crystal or resonator in crystal oscillator mode. optionally functions as clko in rc and ec modes. always associated with osc2 pin function. cn0-cn23 i st input change notification inputs. can be software programmed for internal weak pull-ups on all inputs. cofs csck csdi csdo i/o i/o i o st st st ? data converter interface frame synchronization pin. data converter interface serial clock input/output pin. data converter interface serial data input pin. data converter interface serial data output pin. c1rx c1tx c2rx c2tx i o i o st ? st ? ecan1 bus receive pin. ecan1 bus transmit pin. ecan2 bus receive pin. ecan2 bus transmit pin. pgd1/emud1 pgc1/emuc1 pgd2/emud2 pgc2/emuc2 pgd3/emud3 pgc3/emuc3 i/o i i/o i i/o i st st st st st st data i/o pin for programming/debugging communication channel 1. clock input pin for programming/debugging communication channel 1. data i/o pin for programming/debugging communication channel 2. clock input pin for programming/debugging communication channel 2. data i/o pin for programming/debugging communication channel 3. clock input pin for programming/debugging communication channel 3. ic1-ic8 i st capture inputs 1 through 8. mclr i/p st master clear (reset) input. this pin is an active-low reset to the device. ocfa ocfb oc1-oc8 i i o st st ? compare fault a input (for compare channels 1, 2, 3 and 4). compare fault b input (for compare channels 5, 6, 7 and 8). compare outputs 1 through 8. osc1 osc2 i i/o st/cmos ? oscillator crystal input. st buffer when configured in rc mode; cmos otherwise. oscillator crystal output. connects to crystal or resonator in crystal oscillator mode. optionally functions as clko in rc and ec modes. ra0-ra7 ra9-ra10 ra12-ra15 i/o i/o i/o st st st porta is a bidirectional i/o port. rb0-rb15 i/o st portb is a bidirectional i/o port. rc1-rc4 rc12-rc15 i/o i/o st st portc is a bidirectional i/o port. rd0-rd15 i/o st portd is a bidirectional i/o port. re0-re7 i/o st porte is a bidirectional i/o port. rf0-rf8 rf12-rf13 i/o st portf is a bidirectional i/o port. rg0-rg3 rg6-rg9 rg12-rg15 i/o i/o i/o st st st portg is a bidirectional i/o port. sck1 sdi1 sdo1 ss1 sck2 sdi2 sdo2 ss2 i/o i o i/o i/o i o i/o st st ? st st st ? st synchronous serial clock input/output for spi1. spi1 data in. spi1 data out. spi1 slave synchronization or frame pulse i/o. synchronous serial clock input/output for spi2. spi2 data in. spi2 data out. spi2 slave synchronization or frame pulse i/o. legend: cmos = cmos compatible input or output; analog = analog input st = schmitt trigger input with cmos levels; o = output; i = input; p = power
dspic33fjxxxgpx06/x08/x10 ds70286a-page 16 ? 2007 microchip technology inc. scl1 sda1 scl2 sda2 i/o i/o i/o i/o st st st st synchronous serial clock input/output for i2c1. synchronous serial data input/output for i2c1. synchronous serial clock input/output for i2c2. synchronous serial data input/output for i2c2. sosci sosco i o st/cmos ? 32.768 khz low-power oscillator crystal input; cmos otherwise. 32.768 khz low-power oscillator crystal output. tms tck tdi tdo i i i o st st st ? jtag test mode select pin. jtag test clock input pin. jtag test data input pin. jtag test data output pin. t1ck t2ck t3ck t4ck t5ck t6ck t7ck t8ck t9ck i i i i i i i i i st st st st st st st st st timer1 external clock input. timer2 external clock input. timer3 external clock input. timer4 external clock input. timer5 external clock input. timer6 external clock input. timer7 external clock input. timer8 external clock input. timer9 external clock input. u1cts u1rts u1rx u1tx u2cts u2rts u2rx u2tx i o i o i o i o st ? st ? st ? st ? uart1 clear to send. uart1 ready to send. uart1 receive. uart1 transmit. uart2 clear to send. uart2 ready to send. uart2 receive. uart2 transmit. v dd p ? positive supply for peripheral logic and i/o pins. v ddcore p ? cpu logic filter capacitor connection. v ss p ? ground reference for logic and i/o pins. v ref + i analog analog voltage reference (high) input. v ref - i analog analog voltage reference (low) input. table 1-1: pinout i/o descriptions (continued) pin name pin type buffer type description legend: cmos = cmos compatible input or output; analog = analog input st = schmitt trigger input with cmos levels; o = output; i = input; p = power
? 2007 microchip technology inc. ds70286a-page 17 dspic33fjxxxgpx06/x08/x10 2.0 cpu the dspic33fjxxxgpx06/x08/x10 cpu module has a 16-bit (data) modified harvard architecture with an enhanced instruction set, including significant support for dsp. the cpu has a 24-bit instruction word with a variable length opcode field. the program counter (pc) is 23 bits wide and addresses up to 4m x 24 bits of user program memory space. the actual amount of program memory implemented varies by device. a single-cycle instruction prefetch mechanism is used to help maintain throughput and provides predictable execution. all instructions execute in a single cycle, with the exception of instructions that change the program flow, the double word move ( mov.d ) instruction and the table instructions. overhead-free pro- gram loop constructs are supported using the do and repeat instructions, both of which are interruptible at any point. the dspic33fjxxxgpx06/x08/x10 devices have sixteen, 16-bit working registers in the programmer?s model. each of the working registers can serve as a data, address or address offset register. the 16th working register (w15) operates as a software stack pointer (sp) for interrupts and calls. the dspic33fjxxxgpx06/x08/x10 instruction set has two classes of instructions: mcu and dsp. these two instruction classes are seamlessly integrated into a single cpu. the instruction set includes many addressing modes and is designed for optimum c compiler efficiency. for most instructions, the dspic33fjxxxgpx06/x08/x10 is capa- ble of executing a data (or program data) memory read, a working register (data) read, a data memory write and a program (instruction) memory read per instruction cycle. as a result, three parameter instructions can be supported, allowing a + b = c operations to be executed in a single cycle. a block diagram of the cpu is shown in figure 2-1. the programmer?s model for the dspic33fjxxxgpx06/x08/x10 is shown in figure 2-2. 2.1 data addressing overview the data space can be addressed as 32k words or 64 kbytes and is split into two blocks, referred to as x and y data memory. each memory block has its own indepen- dent address generation unit (agu). the mcu class of instructions operates solely through the x memory agu, which accesses the entire memory map as one linear data space. certain dsp instructions operate through the x and y agus to support dual operand reads, which splits the data address space into two parts. the x and y data space boundary is device-specific. overhead-free circular buffers (modulo addressing mode) are supported in both x and y address spaces. the modulo addressing removes the software boundary checking over- head for dsp algorithms. furthermore, the x agu circular addressing can be used with any of the mcu class of instructions. the x agu also supports bit-reversed addressing to greatly simplify input or output data reordering for radix-2 fft algorithms. the upper 32 kbytes of the data space memory map can optionally be mapped into program space at any 16k pro- gram word boundary defined by the 8-bit program space visibility page (psvpag) register. the program to data space mapping feature lets any instruction access program space as if it were data space. the data space also includes 2 kbytes of dma ram, which is primarily used for dma data transfers, but may be used as general purpose ram. 2.2 dsp engine overview the dsp engine features a high-speed, 17-bit by 17-bit multiplier, a 40-bit alu, two 40-bit saturating accumula- tors and a 40-bit bidirectional barrel shifter. the barrel shifter is capable of shifting a 40-bit value, up to 16 bits right or left, in a single cycle. the dsp instructions operate seamlessly with all other instructions and have been designed for optimal real-time performance. the mac instruction and other associated instructions can concur- rently fetch two data operands from memory while multi- plying two w registers and accumulating and optionally saturating the result in the same cycle. this instruction functionality requires that the ram memory data space be split for these instructions and linear for all others. data space partitioning is achieved in a transparent and flexible manner through dedicating certain working registers to each address space. 2.3 special mcu features the dspic33fjxxxgpx06/x08/x10 features a 17-bit by 17-bit, single-cycle multiplier that is shared by both the mcu alu and dsp engine. the multiplier can perform signed, unsigned and mixed-sign multiplication. using a 17-bit by 17-bit multiplier for 16-bit by 16-bit multiplication not only allows you to perform mixed-sign multiplication, it also achieves accurate results for special operations, such as (-1.0) x (-1.0). the dspic33fjxxxgpx06/x08/x10 supports 16/16 and 32/16 divide operations, both fractional and integer. all divide instructions are iterative operations. they must be executed within a repeat loop, resulting in a total execu- tion time of 19 instruction cycles. the divide operation can be interrupted during any of those 19 cycles without loss of data. a 40-bit barrel shifter is used to perform up to a 16-bit, left or right shift in a single cycle. the barrel shifter can be used by both mcu and dsp instructions. note: this data sheet summarizes the features of the dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 18 ? 2007 microchip technology inc. figure 2-1: dspic33fjxxxgpx06/ x08/x10 cpu core block diagram instruction decode & control pch pcl program counter 16-bit alu 24 23 instruction reg pcu 16 x 16 w register array rom latch ea mux interrupt controller stack control logic loop control logic data latch address latch control signals to various blocks address bus literal data 16 16 16 to peripheral modules data latch address latch 16 x ram y ram address generator units 16 y data bus x data bus dma controller dma ram dsp engine divide support 16 16 23 23 16 8 psv & table data access control block 16 16 16 16 program memory data latch address latch
? 2007 microchip technology inc. ds70286a-page 19 dspic33fjxxxgpx06/x08/x10 figure 2-2: dspic33fjxxxgpx06/x08/x10 programmer?s model pc22 pc0 7 0 d0 d15 program counter data table page address status register working registers dsp operand registers w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12/dsp offset w13/dsp write back w14/frame pointer w15/stack pointer dsp address registers ad39 ad0 ad31 dsp accumulators acca accb 7 0 program space visibility page address z 0 oa ob sa sb rcount 15 0 repeat loop counter dcount 15 0 do loop counter dostart 22 0 do loop start address ipl2 ipl1 splim stack pointer limit register ad15 srl push.s shadow do shadow oab sab 15 0 core configuration register legend corcon da dc ra n tblpag psvpag ipl0 ov w0/wreg srh do loop end address doend 22 c
dspic33fjxxxgpx06/x08/x10 ds70286a-page 20 ? 2007 microchip technology inc. 2.4 cpu control registers cpu control registers include: ? sr: cpu status register ? corcon: core control register register 2-1: sr: cpu status register r-0 r-0 r/c-0 r/c-0 r-0 r/c-0 r -0 r/w-0 oa ob sa (1) sb (1) oab sab da dc bit 15 bit 8 r/w-0 (2) r/w-0 (3) r/w-0 (3) r-0 r/w-0 r/w-0 r/w-0 r/w-0 ipl<2:0> (2) ra n ov z c bit 7 bit 0 legend: c = clear only bit r = readable bit u = unimplemented bit, read as ?0? s = set only bit w = writable bit -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 oa: accumulator a overflow status bit 1 = accumulator a overflowed 0 = accumulator a has not overflowed bit 14 ob: accumulator b overflow status bit 1 = accumulator b overflowed 0 = accumulator b has not overflowed bit 13 sa: accumulator a saturation ?sticky? status bit (1) 1 = accumulator a is saturated or has been saturated at some time 0 = accumulator a is not saturated bit 12 sb: accumulator b saturation ?sticky? status bit (1) 1 = accumulator b is saturated or has been saturated at some time 0 = accumulator b is not saturated bit 11 oab: oa || ob combined accumulator overflow status bit 1 = accumulators a or b have overflowed 0 = neither accumulators a or b have overflowed bit 10 sab: sa || sb combined accumulator ?sticky? status bit 1 = accumulators a or b are saturated or have been saturated at some time in the past 0 = neither accumulator a or b are saturated note: this bit may be read or cleared (not set). clearing this bit will clear sa and sb. bit 9 da: do loop active bit 1 = do loop in progress 0 = do loop not in progress note 1: this bit may be read or cleared (not set). 2: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read only when nstdis = 1 (intcon1<15>).
? 2007 microchip technology inc. ds70286a-page 21 dspic33fjxxxgpx06/x08/x10 bit 8 dc: mcu alu half carry/borrow bit 1 = a carry-out from the 4th low-order bit (for byte sized data) or 8th low-order bit (for word sized data) of the result occurred 0 = no carry-out from the 4th low-order bit (for byte sized data) or 8th low-order bit (for word sized data) of the result occurred bit 7-5 ipl<2:0>: cpu interrupt priority level status bits (2) 111 = cpu interrupt priority level is 7 (15), user interrupts disabled 110 = cpu interrupt priority level is 6 (14) 101 = cpu interrupt priority level is 5 (13) 100 = cpu interrupt priority level is 4 (12) 011 = cpu interrupt priority level is 3 (11) 010 = cpu interrupt priority level is 2 (10) 001 = cpu interrupt priority level is 1 (9) 000 = cpu interrupt priority level is 0 (8) bit 4 ra: repeat loop active bit 1 = repeat loop in progress 0 = repeat loop not in progress bit 3 n: mcu alu negative bit 1 = result was negative 0 = result was non-negative (zero or positive) bit 2 ov: mcu alu overflow bit this bit is used for signed arithmetic (2?s complement). it indicates an overflow of the magnitude which causes the sign bit to change state. 1 = overflow occurred for signed arithmetic (in this arithmetic operation) 0 = no overflow occurred bit 1 z: mcu alu zero bit 1 = an operation which affects the z bit has set it at some time in the past 0 = the most recent operation which affects the z bit has cleared it (i.e., a non-zero result) bit 0 c: mcu alu carry/borrow bit 1 = a carry-out from the most significant bit of the result occurred 0 = no carry-out from the most significant bit of the result occurred register 2-1: sr: cpu status register (continued) note 1: this bit may be read or cleared (not set). 2: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read only when nstdis = 1 (intcon1<15>).
dspic33fjxxxgpx06/x08/x10 ds70286a-page 22 ? 2007 microchip technology inc. register 2-2: corcon: core control register u-0 u-0 u-0 r/w-0 r/w-0 r-0 r-0 r-0 ? ? ?usedt (1) dl<2:0> bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-0 r/c-0 r/w-0 r/w-0 r/w-0 sata satb satdw accsat ipl3 (2) psv rnd if bit 7 bit 0 legend: c = clear only bit r = readable bit w = writable bit -n = value at por ?1? = bit is set 0? = bit is cleared ?x = bit is unknown u = unimplemented bit, read as ?0? bit 15-13 unimplemented: read as ? 0 ? bit 12 us: dsp multiply unsigned/signed control bit 1 = dsp engine multiplies are unsigned 0 = dsp engine multiplies are signed bit 11 edt: early do loop termination control bit (1) 1 = terminate executing do loop at end of current loop iteration 0 = no effect bit 10-8 dl<2:0>: do loop nesting level status bits 111 = 7 do loops active ? ? ? 001 = 1 do loop active 000 = 0 do loops active bit 7 sata: acca saturation enable bit 1 = accumulator a saturation enabled 0 = accumulator a saturation disabled bit 6 satb: accb saturation enable bit 1 = accumulator b saturation enabled 0 = accumulator b saturation disabled bit 5 satdw: data space write from dsp engine saturation enable bit 1 = data space write saturation enabled 0 = data space write saturation disabled bit 4 accsat: accumulator saturation mode select bit 1 = 9.31 saturation (super saturation) 0 = 1.31 saturation (normal saturation) bit 3 ipl3: cpu interrupt priority level status bit 3 (2) 1 = cpu interrupt priority level is greater than 7 0 = cpu interrupt priority level is 7 or less bit 2 psv: program space visibility in data space enable bit 1 = program space visible in data space 0 = program space not visible in data space bit 1 rnd: rounding mode select bit 1 = biased (conventional) rounding enabled 0 = unbiased (convergent) rounding enabled bit 0 if: integer or fractional multiplier mode select bit 1 = integer mode enabled for dsp multiply ops 0 = fractional mode enabled for dsp multiply ops note 1: this bit will always read as ? 0 ?. 2: the ipl3 bit is concatenated with the ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level.
? 2007 microchip technology inc. ds70286a-page 23 dspic33fjxxxgpx06/x08/x10 2.5 arithmetic logic unit (alu) the dspic33fjxxxgpx06/x08/x10 alu is 16 bits wide and is capable of addition, subtraction, bit shifts and logic operations. unless otherwise mentioned, arithmetic operations are 2?s complement in nature. depending on the operation, the alu may affect the values of the carry (c), zero (z), negative (n), over- flow (ov) and digit carry (dc) status bits in the sr register. the c and dc status bits operate as borrow and digit borrow bits, respectively, for subtraction oper- ations. the alu can perform 8-bit or 16-bit operations, depending on the mode of the instruction that is used. data for the alu operation can come from the w reg- ister array, or data memory, depending on the address- ing mode of the instruction. likewise, output data from the alu can be written to the w register array or a data memory location. refer to the ? dspic30f/33f programmer?s reference manual? (ds70157) for information on the sr bits affected by each instruction. the dspic33fjxxxgpx06/x08/x10 cpu incorpo- rates hardware support for both multiplication and divi- sion. this includes a dedicated hardware multiplier and support hardware for 16-bit-divisor division. 2.5.1 multiplier using the high-speed 17-bit x 17-bit multiplier of the dsp engine, the alu supports unsigned, signed or mixed-sign operation in several mcu multiplication modes: 1. 16-bit x 16-bit signed 2. 16-bit x 16-bit unsigned 3. 16-bit signed x 5-bit (literal) unsigned 4. 16-bit unsigned x 16-bit unsigned 5. 16-bit unsigned x 5-bit (literal) unsigned 6. 16-bit unsigned x 16-bit signed 7. 8-bit unsigned x 8-bit unsigned 2.5.2 divider the divide block supports 32-bit/16-bit and 16-bit/16-bit signed and unsigned integer divide operations with the following data sizes: 1. 32-bit signed/16-bit signed divide 2. 32-bit unsigned/16-bit unsigned divide 3. 16-bit signed/16-bit signed divide 4. 16-bit unsigned/16-bit unsigned divide the quotient for all divide instructions ends up in w0 and the remainder in w1. 16-bit signed and unsigned div instructions can specify any w register for both the 16-bit divisor (wn) and any w register (aligned) pair (w(m + 1):wm) for the 32-bit dividend. the divide algo- rithm takes one cycle per bit of divisor, so both 32-bit/16-bit and 16-bit/16-bit instructions take the same number of cycles to execute. 2.6 dsp engine the dsp engine consists of a high-speed, 17-bit x 17-bit multiplier, a barrel shifter and a 40-bit adder/subtracter (with two target accumulators, round and saturation logic). the dspic33fjxxxgpx06/x08/x10 is a single-cycle, instruction flow architecture; therefore, concurrent opera- tion of the dsp engine with mcu instruction flow is not possible. however, some mcu alu and dsp engine resources may be used concurrently by the same instruc- tion (e.g., ed, edac). the dsp engine also has the capability to perform inherent accumulator-to-accumulator operations which require no additional data. these instructions are add, sub and neg . the dsp engine has various options selected through various bits in the cpu core control register (corcon), as listed below: 1. fractional or integer dsp multiply (if). 2. signed or unsigned dsp multiply (us). 3. conventional or convergent rounding (rnd). 4. automatic saturation on/off for acca (sata). 5. automatic saturation on/off for accb (satb). 6. automatic saturation on/off for writes to data memory (satdw). 7. accumulator saturation mode selection (accsat). table 2-1 provides a summary of dsp instructions. a block diagram of the dsp engine is shown in figure 2-3. table 2-1: dsp instructions summary instruction algebraic operation acc write back clr a = 0 yes ed a = (x ? y) 2 no edac a = a + (x ? y) 2 no mac a = a + (x * y) yes mac a = a + x 2 no movsac no change in a yes mpy a = x * y no mpy a = x 2 no mpy.n a = ? x * y no msc a = a ? x * y yes
dspic33fjxxxgpx06/x08/x10 ds70286a-page 24 ? 2007 microchip technology inc. figure 2-3: dsp engine block diagram zero backfill sign-extend barrel shifter 40-bit accumulator a 40-bit accumulator b round logic x data bus to/from w array adder saturate negate 32 32 33 16 16 16 16 40 40 40 40 s a t u r a t e y data bus 40 carry/borrow out carry/borrow in 16 40 multiplier/scaler 17-bit
? 2007 microchip technology inc. ds70286a-page 25 dspic33fjxxxgpx06/x08/x10 2.6.1 multiplier the 17-bit x 17-bit multiplier is capable of signed or unsigned operation and can multiplex its output using a scaler to support either 1.31 fractional (q31) or 32-bit integer results. unsigned operands are zero-extended into the 17th bit of the multiplier input value. signed operands are sign-extended into the 17th bit of the multiplier input value. the output of the 17-bit x 17-bit multiplier/scaler is a 33-bit value which is sign-extended to 40 bits. integer data is inherently rep- resented as a signed two?s complement value, where the msb is defined as a sign bit. generally speaking, the range of an n-bit two?s complement integer is -2 n-1 to 2 n-1 ? 1. for a 16-bit integer, the data range is -32768 (0x8000) to 32767 (0x7fff) including 0. for a 32-bit integer, the data range is -2,147,483,648 (0x8000 0000) to 2,147,483,647 (0x7fff ffff). when the multiplier is configured for fractional multipli- cation, the data is represented as a two?s complement fraction, where the msb is defined as a sign bit and the radix point is implied to lie just after the sign bit (qx format). the range of an n-bit two?s complement fraction with this implied radix point is -1.0 to (1 ? 2 1-n ). for a 16-bit fraction, the q15 data range is -1.0 (0x8000) to 0.999969482 (0x7fff) including 0 and has a precision of 3.01518x10 -5 . in fractional mode, the 16 x 16 multiply operation generates a 1.31 product which has a precision of 4.65661 x 10 -10 . the same multiplier is used to support the mcu multi- ply instructions which include integer 16-bit signed, unsigned and mixed sign multiplies. the mul instruction may be directed to use byte or word sized operands. byte operands will direct a 16-bit result, and word operands will direct a 32-bit result to the specified register(s) in the w array. 2.6.2 data accumulators and adder/subtracter the data accumulator consists of a 40-bit adder/subtracter with automatic sign extension logic. it can select one of two accumulators (a or b) as its pre-accumulation source and post-accumulation desti- nation. for the add and lac instructions, the data to be accumulated or loaded can be optionally scaled via the barrel shifter prior to accumulation. 2.6.2.1 adder/subtracter, overflow and saturation the adder/subtracter is a 40-bit adder with an optional zero input into one side, and either true, or complement data into the other input. in the case of addition, the carry/borrow input is active-high and the other input is true data (not complemented), whereas in the case of subtraction, the carry/borrow input is active-low and the other input is complemented. the adder/subtracter generates overflow status bits, sa/sb and oa/ob, which are latched and reflected in the status register: ? overflow from bit 39: this is a catastrophic overflow in which the sign of the accumulator is destroyed. ? overflow into guard bits 32 through 39: this is a recoverable overflow. this bit is set whenever all the guard bits are not identical to each other. the adder has an additional saturation block which controls accumulator data saturation, if selected. it uses the result of the adder, the overflow status bits described above and the sat (corcon<7:6>) and accsat (corcon<4>) mode control bits to determine when and to what value to saturate. six status register bits have been provided to support saturation and overflow; they are: 1. oa: acca overflowed into guard bits 2. ob: accb overflowed into guard bits 3. sa: acca saturated (bit 31 overflow and saturation) or acca overflowed into guard bits and saturated (bit 39 overflow and saturation) 4. sb: accb saturated (bit 31 overflow and saturation) or accb overflowed into guard bits and saturated (bit 39 overflow and saturation) 5. oab: logical or of oa and ob 6. sab: logical or of sa and sb the oa and ob bits are modified each time data passes through the adder/subtracter. when set, they indicate that the most recent operation has overflowed into the accumulator guard bits (bits 32 through 39). the oa and ob bits can also optionally generate an arithmetic warning trap when set and the correspond- ing overflow trap flag enable bits (ovate, ovbte) in the intcon1 register (refer to section 6.0 ?interrupt controller? ) are set. this allows the user to take immediate action, for example, to correct system gain.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 26 ? 2007 microchip technology inc. the sa and sb bits are modified each time data passes through the adder/subtracter, but can only be cleared by the user. when set, they indicate that the accumulator has overflowed its maximum range (bit 31 for 32-bit saturation or bit 39 for 40-bit saturation) and will be saturated (if saturation is enabled). when saturation is not enabled, sa and sb default to bit 39 overflow and, thus, indicate that a catastrophic over- flow has occurred. if the covte bit in the intcon1 register is set, sa and sb bits will generate an arithmetic warning trap when saturation is disabled. the overflow and saturation status bits can optionally be viewed in the status register (sr) as the logical or of oa and ob (in bit oab) and the logical or of sa and sb (in bit sab). this allows programmers to check one bit in the status register to determine if either accumulator has overflowed, or one bit to determine if either accumulator has saturated. this would be useful for complex number arithmetic which typically uses both the accumulators. the device supports three saturation and overflow modes: 1. bit 39 overflow and saturation: when bit 39 overflow and saturation occurs, the saturation logic loads the maximally positive 9.31 (0x7fffffffff), or maximally negative 9.31 value (0x8000000000), into the target accumula- tor. the sa or sb bit is set and remains set until cleared by the user. this is referred to as ?super saturation? and provides protection against erro- neous data or unexpected algorithm problems (e.g., gain calculations). 2. bit 31 overflow and saturation: when bit 31 overflow and saturation occurs, the saturation logic then loads the maximally posi- tive 1.31 value (0x007fffffff), or maximally negative 1.31 value (0x0080000000), into the target accumulator. the sa or sb bit is set and remains set until cleared by the user. when this saturation mode is in effect, the guard bits are not used (so the oa, ob or oab bits are never set). 3. bit 39 catastrophic overflow: the bit 39 overflow status bit from the adder is used to set the sa or sb bit, which remains set until cleared by the user. no saturation operation is performed and the accumulator is allowed to overflow (destroying its sign). if the covte bit in the intcon1 register is set, a catastrophic overflow can initiate a trap exception. 2.6.2.2 accumulator ?write back? the mac class of instructions (with the exception of mpy, mpy.n, ed and edac ) can optionally write a rounded version of the high word (bits 31 through 16) of the accumulator that is not targeted by the instruction into data space memory. the write is performed across the x bus into combined x and y address space. the following addressing modes are supported: 1. w13, register direct: the rounded contents of the non-target accumulator are written into w13 as a 1.15 fraction. 2. [w13]+ = 2, register indirect with post-increment: the rounded contents of the non-target accumu- lator are written into the address pointed to by w13 as a 1.15 fraction. w13 is then incremented by 2 (for a word write). 2.6.2.3 round logic the round logic is a combinational block which performs a conventional (biased) or convergent (unbiased) round function during an accumulator write (store). the round mode is determined by the state of the rnd bit in the corcon register. it generates a 16-bit, 1.15 data value which is passed to the data space write saturation logic. if rounding is not indicated by the instruction, a truncated 1.15 data value is stored and the least significant word is simply discarded. conventional rounding zero-extends bit 15 of the accu- mulator and adds it to the accxh word (bits 16 through 31 of the accumulator). if the accxl word (bits 0 through 15 of the accumulator) is between 0x8000 and 0xffff (0x8000 included), accxh is incremented. if accxl is between 0x0000 and 0x7fff, accxh is left unchanged. a consequence of this algorithm is that over a succession of random rounding operations, the value tends to be biased slightly positive. convergent (or unbiased) rounding operates in the same manner as conventional rounding, except when accxl equals 0x8000. in this case, the least signifi- cant bit (bit 16 of the accumulator) of accxh is examined. if it is ? 1 ?, accxh is incremented. if it is ? 0 ?, accxh is not modified. assuming that bit 16 is effectively random in nature, this scheme removes any rounding bias that may accumulate. the sac and sac.r instructions store either a truncated ( sac ), or rounded ( sac.r ) version of the contents of the target accumulator to data memory via the x bus, subject to data saturation (see section 2.6.2.4 ?data space write saturation? ). for the mac class of instructions, the accumulator write-back operation will function in the same manner, addressing combined mcu (x and y) data space though the x bus. for this class of instructions, the data is always subject to rounding.
? 2007 microchip technology inc. ds70286a-page 27 dspic33fjxxxgpx06/x08/x10 2.6.2.4 data space write saturation in addition to adder/subtracter saturation, writes to data space can also be saturated but without affecting the contents of the source accumulator. the data space write saturation logic block accepts a 16-bit, 1.15 frac- tional value from the round logic block as its input, together with overflow status from the original source (accumulator) and the 16-bit round adder. these inputs are combined and used to select the appropriate 1.15 fractional value as output to write to data space memory. if the satdw bit in the corcon register is set, data (after rounding or truncation) is tested for overflow and adjusted accordingly, for input data greater than 0x007fff, data written to memory is forced to the max- imum positive 1.15 value, 0x7fff. for input data less than 0xff8000, data written to memory is forced to the maximum negative 1.15 value, 0x8000. the most significant bit of the source (bit 39) is used to determine the sign of the operand being tested. if the satdw bit in the corcon register is not set, the input data is always passed through unmodified under all conditions. 2.6.3 barrel shifter the barrel shifter is capable of performing up to 16-bit arithmetic or logic right shifts, or up to 16-bit left shifts in a single cycle. the source can be either of the two dsp accumulators or the x bus (to support multi-bit shifts of register or memory data). the shifter requires a signed binary value to determine both the magnitude (number of bits) and direction of the shift operation. a positive value shifts the operand right. a negative value shifts the operand left. a value of ? 0 ? does not modify the operand. the barrel shifter is 40 bits wide, thereby obtaining a 40-bit result for dsp shift operations and a 16-bit result for mcu shift operations. data from the x bus is pre- sented to the barrel shifter between bit positions 16 to 31 for right shifts, and between bit positions 0 to 16 for left shifts.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 28 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 29 dspic33fjxxxgpx06/x08/x10 3.0 memory organization the dspic33fjxxxgpx06/x08/x10 architecture fea- tures separate program and data memory spaces and buses. this architecture also allows the direct access of program memory from the data space during code execution. 3.1 program address space the program address memory space of the dspic33fjxxxgpx06/x08/x10 devices is 4m instruc- tions. the space is addressable by a 24-bit value derived from either the 23-bit program counter (pc) during pro- gram execution, or from table operation or data space remapping as described in section 3.6 ?interfacing pro- gram and data memory spaces? . user access to the program memory space is restricted to the lower half of the address range (0x000000 to 0x7fffff). the exception is the use of tblrd/tblwt operations, which use tblpag<7> to permit access to the configuration bits and device id sections of the configuration memory space. memory usage for the dspic33fjxxxgpx06/x08/x10 of devices is shown in figure 3-1. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 30 ? 2007 microchip technology inc. figure 3-1: program me mory for dspic33fjxxxgpx06/x08/x10 devices reset address 0x000000 0x0000fe 0x000002 0x000100 device configuration user program flash memory 0x00ac00 0x00abfe (22k instructions) 0x800000 0xf80000 registers 0xf80017 0xf80010 devid (2) 0xfefffe 0xff0000 0xfffffe 0xf7fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe 0x000104 alternate vector table reserved interrupt vector table reset address device configuration registers devid (2) unimplemented (read ? 0 ?s) goto instruction reserved reserved alternate vector table reserved interrupt vector table reset address device configuration user program flash memory (88k instructions) registers devid (2) goto instruction reserved reserved alternate vector table reserved interrupt vector table dspic33fj64gpxxx dspic33fj128gpxxx dspic33fj256gpxxx configuration memory space user memory space 0x015800 0x0157fe user program (44k instructions) flash memory (read ? 0 ?s) unimplemented 0x02ac00 0x02abfe
? 2007 microchip technology inc. ds70286a-page 31 dspic33fjxxxgpx06/x08/x10 3.1.1 program memory organization the program memory space is organized in word-addressable blocks. although it is treated as 24 bits wide, it is more appropriate to think of each address of the program memory as a lower and upper word, with the upper byte of the upper word being unimplemented. the lower word always has an even address, while the upper word has an odd address (figure 3-2). program memory addresses are always word-aligned on the lower word, and addresses are incremented or decremented by two during code execution. this arrangement also provides compatibility with data memory space addressing and makes it possible to access data in the program memory space. 3.1.2 interrupt and trap vectors all dspic33fjxxxgpx06/x08/x10 devices reserve the addresses between 0x00000 and 0x000200 for hard-coded program execution vectors. a hardware reset vector is provided to redirect code execution from the default value of the pc on device reset to the actual start of code. a goto instruction is programmed by the user at 0x000000, with the actual address for the start of code at 0x000002. dspic33fjxxxgpx06/x08/x10 devices also have two interrupt vector tables, located from 0x000004 to 0x0000ff and 0x000100 to 0x0001ff. these vector tables allow each of the many device interrupt sources to be handled by separate interrupt service routines (isrs). a more detailed discussion of the interrupt vec- tor tables is provided in section 6.1 ?interrupt vector table? . figure 3-2: program memory organization 0 8 16 pc address 0x000000 0x000002 0x000004 0x000006 23 00000000 00000000 00000000 00000000 program memory ?phantom? byte (read as ? 0 ?) least significant word most significant word instruction width 0x000001 0x000003 0x000005 0x000007 msw address (lsw address)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 32 ? 2007 microchip technology inc. 3.2 data address space the dspic33fjxxxgpx06/x08/x10 cpu has a sepa- rate 16-bit wide data memory space. the data space is accessed using separate address generation units (agus) for read and write operations. data memory maps of devices with different ram sizes are shown in figure 3-3 through figure 3-5. all effective addresses (eas) in the data memory space are 16 bits wide and point to bytes within the data space. this arrangement gives a data space address range of 64 kbytes or 32k words. the lower half of the data memory space (that is, when ea<15> = 0 ) is used for implemented memory addresses, while the upper half (ea<15> = 1 ) is reserved for the program space visibility area (see section 3.6.3 ?reading data from program memory using program space visibility? ). dspic33fjxxxgpx06/x08/x10 devices implement a total of up to 30 kbytes of data memory. should an ea point to a location outside of this area, an all-zero word or byte will be returned. 3.2.1 data space width the data memory space is organized in byte address- able, 16-bit wide blocks. data is aligned in data memory and registers as 16-bit words, but all data space eas resolve to bytes. the least significant bytes of each word have even addresses, while the most significant bytes have odd addresses. 3.2.2 data memory organization and alignment to maintain backward compatibility with pic ? mcu devices and improve data space memory usage efficiency, the dspic33fjxxxgpx06/x08/x10 instruc- tion set supports both word and byte operations. as a consequence of byte accessibility, all effective address calculations are internally scaled to step through word-aligned memory. for example, the core recog- nizes that post-modified register indirect addressing mode [ws++] will result in a value of ws + 1 for byte operations and ws + 2 for word operations. data byte reads will read the complete word that contains the byte, using the lsb of any ea to determine which byte to select. the selected byte is placed onto the lsb of the data path. that is, data memory and reg- isters are organized as two parallel byte-wide entities with shared (word) address decode but separate write lines. data byte writes only write to the corresponding side of the array or register which matches the byte address. all word accesses must be aligned to an even address. misaligned word data fetches are not supported, so care must be taken when mixing byte and word opera- tions, or translating from 8-bit mcu code. if a mis- aligned read or write is attempted, an address error trap is generated. if the error occurred on a read, the instruction underway is completed; if it occurred on a write, the instruction will be executed but the write does not occur. in either case, a trap is then executed, allow- ing the system and/or user to examine the machine state prior to execution of the address fault. all byte loads into any w register are loaded into the least significant byte. the most significant byte is not modified. a sign-extend instruction ( se ) is provided to allow users to translate 8-bit signed data to 16-bit signed values. alternatively, for 16-bit unsigned data, users can clear the msb of any w register by executing a zero-extend ( ze ) instruction on the appropriate address. 3.2.3 sfr space the first 2 kbytes of the near data space, from 0x0000 to 0x07ff, is primarily occupied by special function registers (sfrs). these are used by the dspic33fjxxxgpx06/x08/x10 core and peripheral modules for controlling the operation of the device. sfrs are distributed among the modules that they control, and are generally grouped together by module. much of the sfr space contains unused addresses; these are read as ? 0 ?. a complete listing of implemented sfrs, including their addresses, is shown in table 3-1 through table 3-32. 3.2.4 near data space the 8-kbyte area between 0x0000 and 0x1fff is referred to as the near data space. locations in this space are directly addressable via a 13-bit absolute address field within all memory direct instructions. additionally, the whole data space is addressable using mov instructions, which support memory direct addressing mode with a 16-bit address field, or by using indirect addressing mode using a working register as an address pointer. note: the actual set of peripheral features and interrupts varies by the device. please refer to the corresponding device tables and pinout diagrams for device-specific information.
? 2007 microchip technology inc. ds70286a-page 33 dspic33fjxxxgpx06/x08/x10 figure 3-3: data memory map for dspic3 3fjxxxgpx06/x08/x10 devices with 8 kb ram 0x0000 0x07fe 0x17fe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x07ff 0x17ff 0xffff optionally mapped into program memory 0x27ff 0x27fe 0x0801 0x0800 0x1801 0x1800 2 kbyte sfr space 8 kbyte sram space 0x8001 0x8000 0x2800 0x2801 0x1ffe 0x2000 0x1fff 0x2001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) dma ram y data ram (y)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 34 ? 2007 microchip technology inc. figure 3-4: data memory map for dspic3 3fjxxxgpx06/x08/x10 devices with 16 kb ram 0x0000 0x07fe 0x27fe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x07ff 0x27ff 0xffff optionally mapped into program memory 0x47ff 0x47fe 0x0801 0x0800 0x2801 0x2800 near data 2 kbyte sfr space 16 kbyte sram space 8 kbyte space 0x8001 0x8000 0x4800 0x4801 0x3ffe 0x4000 0x3fff 0x4001 0x1ffe 0x1fff sfr space x data ram (x) x data unimplemented (x) dma ram y data ram (y)
? 2007 microchip technology inc. ds70286a-page 35 dspic33fjxxxgpx06/x08/x10 figure 3-5: data memory map for dspic3 3fjxxxgpx06/x08/x10 devices with 30 kb ram 0x0000 0x07fe sfr space 0xfffe x data ram (x) 16 bits lsb msb 0x0001 0x07ff 0xffff x data optionally mapped into program memory unimplemented (x) 0x0801 0x0800 2-kbyte sfr space 0x4800 0x47fe 0x4801 0x47ff 0x7ffe 0x8000 30-kbyte sram space 0x7fff 0x8001 y data ram (y) near data 8-kbyte space 0x77fe 0x7800 0x77ff 0x7800 lsb address msb address dma ram
dspic33fjxxxgpx06/x08/x10 ds70286a-page 36 ? 2007 microchip technology inc. 3.2.5 x and y data spaces the core has two data spaces, x and y. these data spaces can be considered either separate (for some dsp instructions), or as one unified linear address range (for mcu instructions). the data spaces are accessed using two address generation units (agus) and separate data paths. this feature allows certain instructions to concurrently fetch two words from ram, thereby enabling efficient execution of dsp algorithms such as finite impulse response (fir) filtering and fast fourier transform (fft). the x data space is used by all instructions and supports all addressing modes. there are separate read and write data buses for x data space. the x read data bus is the read data path for all instructions that view data space as combined x and y address space. it is also the x data prefetch path for the dual operand dsp instructions ( mac class). the y data space is used in concert with the x data space by the mac class of instructions ( clr, ed, edac, mac, movsac, mpy, mpy.n and msc ) to provide two concurrent data read paths. both the x and y data spaces support modulo addressing mode for all instructions, subject to addressing mode restrictions. bit-reversed addressing mode is only supported for writes to x data space. all data memory writes, including in dsp instructions, view data space as combined x and y address space. the boundary between the x and y data spaces is device-dependent and is not user-programmable. all effective addresses are 16 bits wide and point to bytes within the data space. therefore, the data space address range is 64 kbytes, or 32k words, though the implemented memory locations vary by device. 3.2.6 dma ram every dspic33fjxxxgpx06/x08/x10 device contains 2 kbytes of dual ported dma ram located at the end of y data space. memory locations is part of y data ram and is in the dma ram space are accessible simultaneously by the cpu and the dma controller module. dma ram is utilized by the dma controller to store data to be transferred to various peripherals using dma, as well as data transferred from various peripherals using dma. the dma ram can be accessed by the dma controller without having to steal cycles from the cpu. when the cpu and the dma controller attempt to concurrently write to the same dma ram location, the hardware ensures that the cpu is given precedence in accessing the dma ram location. therefore, the dma ram provides a reliable means of transferring dma data without ever having to stall the cpu. note: dma ram can be used for general purpose data storage if the dma function is not required in an application.
? 2007 microchip technology inc. ds70286a-page 37 dspic33fjxxxgpx06/x08/x10 table 3-1: cpu core registers map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets wreg0 0000 working register 0 0000 wreg1 0002 working register 1 0000 wreg2 0004 working register 2 0000 wreg3 0006 working register 3 0000 wreg4 0008 working register 4 0000 wreg5 000a working register 5 0000 wreg6 000c working register 6 0000 wreg7 000e working register 7 0000 wreg8 0010 working register 8 0000 wreg9 0012 working register 9 0000 wreg10 0014 working register 10 0000 wreg11 0016 working register 11 0000 wreg12 0018 working register 12 0000 wreg13 001a working register 13 0000 wreg14 001c working register 14 0000 wreg15 001e working register 15 0800 splim 0020 stack pointer limit register xxxx pcl 002e program counter low word register 0000 pch 0030 ? ? ? ? ? ? ? ? program counter high byte register 0000 tblpag 0032 ? ? ? ? ? ? ? ? table page address pointer register 0000 psvpag 0034 ? ? ? ? ? ? ? ? program memory visibility page address pointer register 0000 rcount 0036 repeat loop counter register xxxx dcount 0038 dcount<15:0> xxxx dostartl 003a dostartl<15:1> 0xxxx dostarth 003c ? ? ? ? ? ? ? ? ? ? dostarth<5:0> 00xx doendl 003e doendl<15:1> 0xxxx doendh 0040 ? ? ? ? ? ? ? ? ? ? doendh 00xx sr 0042 oa ob sa sb oab sab da dc ipl2 ipl1 ipl0 ra n ov z c 0000 corcon 0044 ? ? ? us edt dl<2:0> sata satb satdw accsat ipl3 psv rnd if 0000 modcon 0046 xmoden ymoden ? ? bwm<3:0> ywm<3:0> xwm<3:0> 0000 xmodsrt 0048 xs<15:1> 0xxxx xmodend 004a xe<15:1> 1xxxx ymodsrt 004c ys<15:1> 0xxxx ymodend 004e ye<15:1> 1xxxx xbrev 0050 bren xb<14:0> xxxx disicnt 0052 ? ? disable interrupts counter register xxxx bsram 0750 ? ? ? ? ? ? ? ? ? ? ? ? ? iw_bsr ir_bsr rl_bsr 0000 ssram 0752 ? ? ? ? ? ? ? ? ? ? ? ? ? iw_ssr ir_ssr rl_ssr 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 38 ? 2007 microchip technology inc. table 3-2: change notifi cation register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets cnen1 0060 cn15ie cn14ie cn13ie cn12ie cn11ie cn10ie cn9ie cn8ie cn7ie cn6ie cn5ie cn4ie cn3ie cn2ie cn1ie cn0ie 0000 cnen2 0062 ? ? ? ? ? ? ? ? cn23ie cn22ie cn21ie cn20ie cn19ie cn18ie cn17ie cn16ie 0000 cnpu1 0068 cn15pue cn14pue cn13pue cn12pue cn11pue cn10pue cn9pue cn8 pue cn7pue cn6pue cn5pue cn4pue cn3pue cn2pue cn1pue cn0pue 0000 cnpu2 006a ? ? ? ? ? ? ? ? cn23pue cn22pue cn21pue cn20pue cn19pue cn18pue cn17pue cn16pue 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 39 dspic33fjxxxgpx06/x08/x10 table 3-3: interrupt controller register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets intcon1 0080 nstdis ovaerr ovberr covaerr covberr ovate ovbte co vte sftacerr div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 0082 altivt disi ? ? ? ? ? ? ? ? ? int4ep int3ep int2ep int1ep int0ep 0000 ifs0 0084 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0086 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ic8if ic7if ad2if int1if cnif ? mi2c1if si2c1if 0000 ifs2 0088 t6if dma4if ? oc8if oc7if oc6if oc5if ic6if ic5if ic4if ic3if dma3if c1if c1rxif spi2if spi2eif 0000 ifs3 008a ? dma5if dciif dcieif c2if c2rxif int4if int3if t9if t8if mi2c2if si2c2if t7if 0000 ifs4 008c ? ? ? ? ? ? ? ? c2txif c1txif dma7if dma6if ?u2eifu1eif 0000 iec0 0094 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0096 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ic8ie ic7ie ad2ie int1ie cnie ? mi2c1ie si2c1ie 0000 iec2 0098 t6ie dma4ie ? oc8ie oc7ie oc6ie oc5ie ic6ie ic5ie ic4ie ic3ie dma3ie c1ie c1rxie spi2ie spi2eie 0000 iec3 009a ? dma5ie dciie dcieie c2ie c2rxie int4ie int3ie t9ie t8ie mi2c2ie si2c2ie t7ie 0000 iec4 009c ? ? ? ? ? ? ? ? c2txie c1txie dma7ie dma6ie ?u2eieu1eie 0000 ipc0 00a4 ? t1ip<2:0> ?oc1ip<2:0> ?ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 00a6 ? t2ip<2:0> ?oc2ip<2:0> ?ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 00a8 ? u1rxip<2:0> ? spi1ip<2:0> ? spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 00aa ? ? ? ? ? dma1ip<2:0> ? ad1ip<2:0> ? u1txip<2:0> 4444 ipc4 00ac ? cnip<2:0> ? ? ? ? ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 00ae ? ic8ip<2:0> ?ic7ip<2:0> ? ad2ip<2:0> ? int1ip<2:0> 4444 ipc6 00b0 ? t4ip<2:0> ?oc4ip<2:0> ?oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 00b2 ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 00b4 ? c1ip<2:0> ? c1rxip<2:0> ? spi2ip<2:0> ? spi2eip<2:0> 4444 ipc9 00b6 ? ic5ip<2:0> ?ic4ip<2:0> ?ic3ip<2:0> ? dma3ip<2:0> 4444 ipc10 00b8 ? oc7ip<2:0> ?oc6ip<2:0> ?oc5ip<2:0> ?ic6ip<2:0> 4444 ipc11 00ba ? t6ip<2:0> ? dma4ip<2:0> ? ? ? ? ? oc8ip<2:0> 4444 ipc12 00bc ? t8ip<2:0> ? mi2c2ip<2:0> ? si2c2ip<2:0> ? t7ip<2:0> 4444 ipc13 00be ? c2rxip<2:0> ? int4ip<2:0> ? int3ip<2:0> ? t9ip<2:0> 4444 ipc14 00c0 ? dcieip<2:0> ? ? ? c2ip<2:0> 4444 ipc15 00c2 ? ? ? ? ? ? dma5ip<2:0> ? dciip<2:0> 4444 ipc16 00c4 ? ? ? ? ? u2eip<2:0> ? u1eip<2:0> ? 4444 ipc17 00c6 ? c2txip<2:0> ? c1txip<2:0> ? dma7ip<2:0> ? dma6ip<2:0> 4444 inttreg 00e0 ? ? ? ? ilr<3:0> ? vecnum<6:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 40 ? 2007 microchip technology inc. table 3-4: timer register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets tmr1 0100 timer1 register xxxx pr1 0102 period register 1 ffff t1con 0104 ton ? tsidl ? ? ? ? ? ? tgate tckps<1:0> ? tsync tcs ? 0000 tmr2 0106 timer2 register xxxx tmr3hld 0108 timer3 holding register (for 32-bit timer operations only) xxxx tmr3 010a timer3 register xxxx pr2 010c period register 2 ffff pr3 010e period register 3 ffff t2con 0110 ton ? tsidl ? ? ? ? ? ? tgate tckps<1:0> t32 ? tcs ? 0000 t3con 0112 ton ? tsidl ? ? ? ? ? ? tgate tckps<1:0> ? ? tcs ? 0000 tmr4 0114 timer4 register xxxx tmr5hld 0116 timer5 holding register (for 32-bit operations only) xxxx tmr5 0118 timer5 register xxxx pr4 011a period register 4 ffff pr5 011c period register 5 ffff t4con 011e ton ? tsidl ? ? ? ? ? ? tgate tckps<1:0> t32 ? tcs ? 0000 t5con 0120 ton ? tsidl ? ? ? ? ? ? tgate tckps<1:0> ? ? tcs ? 0000 tmr6 0122 timer6 register xxxx tmr7hld 0124 timer7 holding register (for 32-bit operations only) xxxx tmr7 0126 timer7 register xxxx pr6 0128 period register 6 ffff pr7 012a period register 7 ffff t6con 012c ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> t32 ?tcs ? 0000 t7con 012e ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> ? ?tcs ? 0000 tmr8 0130 timer8 register xxxx tmr9hld 0132 timer9 holding register (for 32-bit operations only) xxxx tmr9 0134 timer9 register xxxx pr8 0136 period register 8 ffff pr9 0138 period register 9 ffff t8con 013a ton ? tsidl ? ? ? ? ? ? tgate tckps<1:0> t32 ? tcs ? 0000 t9con 013c ton ? tsidl ? ? ? ? ? ? tgate tckps<1:0> ? ? tcs ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 41 dspic33fjxxxgpx06/x08/x10 table 3-5: input capture register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ic1buf 0140 input 1 capture register xxxx ic1con 0142 ? ? icsidl ? ? ? ? ? ictmr ici<1:0> icov icbne icm<2:0> 0000 ic2buf 0144 input 2 capture register xxxx ic2con 0146 ? ? icsidl ? ? ? ? ? ictmr ici<1:0> icov icbne icm<2:0> 0000 ic3buf 0148 input 3 capture register xxxx ic3con 014a ? ? icsidl ? ? ? ? ? ictmr ici<1:0> icov icbne icm<2:0> 0000 ic4buf 014c input 4 capture register xxxx ic4con 014e ? ? icsidl ? ? ? ? ? ictmr ici<1:0> icov icbne icm<2:0> 0000 ic5buf 0150 input 5 capture register xxxx ic5con 0152 ? ? icsidl ? ? ? ? ? ictmr ici<1:0> icov icbne icm<2:0> 0000 ic6buf 0154 input 6 capture register xxxx ic6con 0156 ? ? icsidl ? ? ? ? ? ictmr ici<1:0> icov icbne icm<2:0> 0000 ic7buf 0158 input 7 capture register xxxx ic7con 015a ? ? icsidl ? ? ? ? ? ictmr ici<1:0> icov icbne icm<2:0> 0000 ic8buf 015c input 8 capture register xxxx ic8con 015e ? ? icsidl ? ? ? ? ? ictmr ici<1:0> icov icbne icm<2:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 42 ? 2007 microchip technology inc. table 3-6: output compare register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets oc1rs 0180 output compare 1 secondary register xxxx oc1r 0182 output compare 1 register xxxx oc1con 0184 ? ? ocsidl ? ? ? ? ? ? ? ? ocflt octsel ocm<2:0> 0000 oc2rs 0186 output compare 2 secondary register xxxx oc2r 0188 output compare 2 register xxxx oc2con 018a ? ? ocsidl ? ? ? ? ? ? ? ? ocflt octsel ocm<2:0> 0000 oc3rs 018c output compare 3 secondary register xxxx oc3r 018e output compare 3 register xxxx oc3con 0190 ? ? ocsidl ? ? ? ? ? ? ? ? ocflt octsel ocm<2:0> 0000 oc4rs 0192 output compare 4 secondary register xxxx oc4r 0194 output compare 4 register xxxx oc4con 0196 ? ? ocsidl ? ? ? ? ? ? ? ? ocflt octsel ocm<2:0> 0000 oc5rs 0198 output compare 5 secondary register xxxx oc5r 019a output compare 5 register xxxx oc5con 019c ? ? ocsidl ? ? ? ? ? ? ? ? ocflt octsel ocm<2:0> 0000 oc6rs 019e output compare 6 secondary register xxxx oc6r 01a0 output compare 6 register xxxx oc6con 01a2 ? ? ocsidl ? ? ? ? ? ? ? ? ocflt octsel ocm<2:0> 0000 oc7rs 01a4 output compare 7 secondary register xxxx oc7r 01a6 output compare 7 register xxxx oc7con 01a8 ? ? ocsidl ? ? ? ? ? ? ? ? ocflt octsel ocm<2:0> 0000 oc8rs 01aa output compare 8 secondary register xxxx oc8r 01ac output compare 8 register xxxx oc8con 01ae ? ? ocsidl ? ? ? ? ? ? ? ? ocflt octsel ocm<2:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 43 dspic33fjxxxgpx06/x08/x10 table 3-7: i2c1 register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets i2c1rcv 0200 ? ? ? ? ? ? ? ? receive register 0000 i2c1trn 0202 ? ? ? ? ? ? ? ? transmit register 00ff i2c1brg 0204 ? ? ? ? ? ? ? baud rate generator register 0000 i2c1con 0206 i2cen ? i2csidl sclrel ipmien a10m disslw smen gcen stren ackdt acken rcen pen rsen sen 1000 i2c1stat 0208 ackstat trstat ? ? ? bcl gcstat add10 iwcol i2cov d_a p s r_w rbf tbf 0000 i2c1add 020a ? ? ? ? ? ? address register 0000 i2c1msk 020c ? ? ? ? ? ? address mask register 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 3-8: i2c2 register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets i2c2rcv 0210 ? ? ? ? ? ? ? ? receive register 0000 i2c2trn 0212 ? ? ? ? ? ? ? ? transmit register 00ff i2c2brg 0214 ? ? ? ? ? ? ? baud rate generator register 0000 i2c2con 0216 i2cen ? i2csidl sclrel ipmien a10m disslw smen gcen stren ackdt acken rcen pen rsen sen 1000 i2c2stat 0218 ackstat trstat ? ? ? bcl gcstat add10 iwcol i2cov d_a p s r_w rbf tbf 0000 i2c2add 021a ? ? ? ? ? ? address register 0000 i2c2msk 021c ? ? ? ? ? ? address mask register 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 44 ? 2007 microchip technology inc. table 3-9: uart1 register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets u1mode 0220 uarten ? usidl iren rtsmd ? uen1 uen0 wake lpback abaud urxinv brgh pdsel<1:0> stsel 0000 u1sta 0222 utxisel1 utxinv utxisel0 ? utxbrk utxen utxbf trmt urxisel<1:0> adden ridle perr ferr oerr urxda 0110 u1txreg 0224 ? ? ? ? ? ? ? uart transmit register xxxx u1rxreg 0226 ? ? ? ? ? ? ? uart receive register 0000 u1brg 0228 baud rate generator prescaler 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 3-10: uart2 register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets u2mode 0230 uarten ? usidl iren rtsmd ? uen1 uen0 wake lpback abaud urxinv brgh pdsel<1:0> stsel 0000 u2sta 0232 utxisel1 utxinv utxisel0 ? utxbrk utxen utxbf trmt urxisel<1:0> adden ridle perr ferr oerr urxda 0110 u2txreg 0234 ? ? ? ? ? ? ? uart transmit register xxxx u2rxreg 0236 ? ? ? ? ? ? ? uart receive register 0000 u2brg 0238 baud rate generator prescaler 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 3-11: spi1 register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets spi1stat 0240 spien ? spisidl ? ? ? ? ? ? spirov ? ? ? ? spitbf spirbf 0000 spi1con1 0242 ? ? ? dissck dissdo mode16 smp cke ssen ckp msten spre<2:0> ppre<1:0> 0000 spi1con2 0244 frmen spifsd frmpol ? ? ? ? ? ? ? ? ? ? ?frmdly ? 0000 spi1buf 0248 spi1 transmit and receive buffer register 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 3-12: spi2 register map sfr name sfr addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets spi2stat 0260 spien ?spisidl ? ? ? ? ? ? spirov ? ? ? ? spitbf spirbf 0000 spi2con1 0262 ? ? ? dissck dissdo mode16 smp cke ssen ckp msten spre<2:0> ppre<1:0> 0000 spi2con2 0264 frmen spifsd frmpol ? ? ? ? ? ? ? ? ? ? ? frmdly ? 0000 spi2buf 0268 spi2 transmit and receive buffer register 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 45 dspic33fjxxxgpx06/x08/x10 table 3-13: adc1 register map file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all reset s adc1buf0 0300 adc data buffer 0 xxxx ad1con1 0320 adon ? adsidl addmabm ? ad12b form<1:0> ssrc<2:0> ? simsam asam samp done 0000 ad1con2 0322 vcfg<2:0> ? ? cscna chps<1:0> bufs ? smpi<3:0> bufm alts 0000 ad1con3 0324 adrc ? ? samc<4:0> ? ? adcs<5:0> 0000 ad1chs123 0326 ? ? ? ? ? ch123nb<1:0> ch123sb ? ? ? ? ? ch123na<1:0> ch123sa 0000 ad1chs0 0328 ch0nb ? ? ch0sb<4:0> ch0na ? ? ch0sa<4:0> 0000 ad1pcfgh 032a pcfg31 pcfg30 pcfg 29 pcfg28 pcfg27 pcfg26 pcfg25 pc fg24 pcfg23 pcfg22 pcfg21 pcfg 20 pcfg19 pcfg18 pcfg17 pcfg16 0000 ad1pcfgl 032c pcfg15 pcfg14 pc fg13 pcfg12 pcfg11 pcfg10 pc fg9 pcfg8 pcfg7 pcfg6 pcfg5 pcfg4 pcfg3 pcfg2 pcfg1 pcfg0 0000 ad1cssh 032e css31 css30 css29 css28 css27 css26 css25 css24 css23 css22 css21 css20 css19 css18 css17 css16 0000 ad1cssl 0330 css15 css14 css13 css12 css11 css10 css9 css8 css7 css6 css5 css4 css3 css2 css1 css0 0000 ad1con4 0332 ? ? ? ? ? ? ? ? ? ? ? ? ? dmabl<2:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 3-14: adc2 register map file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets adc2buf0 0340 adc data buffer 0 xxxx ad2con1 0360 adon ? adsidl addmabm ? ad12b form<1:0> ssrc<2:0> ? simsam asam samp done 0000 ad2con2 0362 vcfg<2:0> ? ? cscna chps<1:0> bufs ? smpi<3:0> bufm alts 0000 ad2con3 0364 adrc ? ? samc<4:0> ? ? adcs<5:0> 0000 ad2chs123 0366 ? ? ? ? ? ch123nb<1:0> ch123sb ? ? ? ? ? ch123na<1:0> ch123sa 0000 ad2chs0 0368 ch0nb ? ? ? ch0sb<3:0> ch0na ? ? ? ch0sa<3:0> 0000 reserved 036a ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ad2pcfgl 036c pcfg15 pcfg14 pcfg13 pcfg12 pcfg11 pcfg10 pc fg9 pcfg8 pcfg7 pcfg6 pcfg5 pcfg4 pcfg3 pcfg2 pcfg1 pcfg0 0000 reserved 036e ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ad2cssl 0370 css15 css14 css13 css12 css11 css10 c ss9 css8 css7 css6 css5 cs s4 css3 css2 css1 css0 0000 ad2con4 0372 ? ? ? ? ? ? ? ? ? ? ? ? ? dmabl<2:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 46 ? 2007 microchip technology inc. table 3-15: dma register map file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets dma0con 0380 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma0req 0382 force ? ? ? ? ? ? ? ? irqsel<6:0> 0000 dma0sta 0384 sta<15:0> 0000 dma0stb 0386 stb<15:0> 0000 dma0pad 0388 pad<15:0> 0000 dma0cnt 038a ? ? ? ? ? ? cnt<9:0> 0000 dma1con 038c chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma1req 038e force ? ? ? ? ? ? ? ? irqsel<6:0> 0000 dma1sta 0390 sta<15:0> 0000 dma1stb 0392 stb<15:0> 0000 dma1pad 0394 pad<15:0> 0000 dma1cnt 0396 ? ? ? ? ? ? cnt<9:0> 0000 dma2con 0398 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma2req 039a force ? ? ? ? ? ? ? ? irqsel<6:0> 0000 dma2sta 039c sta<15:0> 0000 dma2stb 039e stb<15:0> 0000 dma2pad 03a0 pad<15:0> 0000 dma2cnt 03a2 ? ? ? ? ? ? cnt<9:0> 0000 dma3con 03a4 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma3req 03a6 force ? ? ? ? ? ? ? ? irqsel<6:0> 0000 dma3sta 03a8 sta<15:0> 0000 dma3stb 03aa stb<15:0> 0000 dma3pad 03ac pad<15:0> 0000 dma3cnt 03ae ? ? ? ? ? ? cnt<9:0> 0000 dma4con 03b0 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma4req 03b2 force ? ? ? ? ? ? ? ? irqsel<6:0> 0000 dma4sta 03b4 sta<15:0> 0000 dma4stb 03b6 stb<15:0> 0000 dma4pad 03b8 pad<15:0> 0000 dma4cnt 03ba ? ? ? ? ? ? cnt<9:0> 0000 dma5con 03bc chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma5req 03be force ? ? ? ? ? ? ? ? irqsel<6:0> 0000 dma5sta 03c0 sta<15:0> 0000 dma5stb 03c2 stb<15:0> 0000 dma5pad 03c4 pad<15:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 47 dspic33fjxxxgpx06/x08/x10 dma5cnt 03c6 ? ? ? ? ? ? cnt<9:0> 0000 dma6con 03c8 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma6req 03ca force ? ? ? ? ? ? ? ? irqsel<6:0> 0000 dma6sta 03cc sta<15:0> 0000 dma6stb 03ce stb<15:0> 0000 dma6pad 03d0 pad<15:0> 0000 dma6cnt 03d2 ? ? ? ? ? ? cnt<9:0> 0000 dma7con 03d4 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma7req 03d6 force ? ? ? ? ? ? ? ? irqsel<6:0> 0000 dma7sta 03d8 sta<15:0> 0000 dma7stb 03da stb<15:0> 0000 dma7pad 03dc pad<15:0> 0000 dma7cnt 03de ? ? ? ? ? ? cnt<9:0> 0000 dmacs0 03e0 pwcol7 pwcol6 pwcol5 pwcol4 pwcol3 pwcol2 pwcol1 pwcol0 xwcol7 xwcol6 xwcol5 xwcol4 xwcol3 xwcol2 xwcol1 xwcol0 0000 dmacs1 03e2 ? ? ? ? lstch<3:0> ppst7 ppst6 ppst5 ppst4 ppst3 ppst2 ppst1 ppst0 0000 dsadr 03e4 dsadr<15:0> 0000 table 3-15: dma register map (continued) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 48 ? 2007 microchip technology inc. table 3-16: ecan1 register map when c1ctrl1.win = 0 or 1 file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets c1ctrl1 0400 ? ? csidl abat cancks reqop<2:0> opmode<2:0> ? cancap ? ?win 0480 c1ctrl2 0402 ? ? ? ? ? ? ? ? ? ? ? dncnt<4:0> 0000 c1vec 0404 ? ? ?filhit<4:0> ? icode<6:0> 0000 c1fctrl 0406 dmabs<2:0> ? ? ? ? ? ? ? ? fsa<4:0> 0000 c1fifo 0408 ? ?fbp<5:0> ? ? fnrb<5:0> 0000 c1intf 040a ? ? txbo txbp rxbp txwar rxwar ewarn ivrif wakif errif ? fifoif rbovif rbif tbif 0000 c1inte 040c ? ? ? ? ? ? ? ? ivrie wakie errie ? fifoie rbovie rbie tbie 0000 c1ec 040e terrcnt<7:0> rerrcnt<7:0> 0000 c1cfg1 0410 ? ? ? ? ? ? ? ? sjw<1:0> brp<5:0> 0000 c1cfg2 0412 ?wakfil ? ? ? seg2ph<2:0> seg2phts sam seg1ph<2:0> prseg<2:0> 0000 c1fen1 0414 flten15 flten14 flten13 flten12 flten11 flten10 flten9 flte n8 flten7 flten6 flten5 flten4 flten3 flten2 flten1 flten0 0000 c1fmsksel1 0418 f7msk<1:0> f6msk<1:0> f5msk<1:0> f4msk< 1:0> f3msk<1:0> f2msk<1:0> f1msk<1:0> f0msk<1:0> 0000 c1fmsksel2 041a f15msk<1:0> f14msk<1:0> f13msk<1:0> f12msk <1:0> f11msk<1:0> f10msk<1:0> f9msk<1:0> f8msk<1:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 3-17: ecan1 register map when c1ctrl1.win = 0 file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets 0400- 041e see definition when win = x c1rxful1 0420 rxful15 rxful14 rxful13 rxful12 rxful11 rxful10 rxful9 rxful8 rxful7 rxful6 rxful5 rxful4 rxful3 rxful2 rxful1 rxful0 0000 c1rxful2 0422 rxful31 rxful30 rxful29 rxful28 rxful27 rxful26 rxful25 rxful24 rxful23 rxful22 rxful21 rxful20 rxful19 rxful18 rxful17 rxful16 0000 c1rxovf1 0428 rxovf15 rxovf14 rxovf13 rxovf12 rxovf11 rxovf10 rxov f9 rxovf8 rxovf7 rxovf6 rxovf5 rx ovf4 rxovf3 rxovf2 rxovf1 rxovf0 0000 c1rxovf2 042a rxovf31 rxovf30 rxovf29 rxovf28 rxovf27 rxovf26 rxovf25 rxovf24 rxovf23 rxovf22 rxovf21 rxovf20 rxovf19 rxovf18 rxovf17 rxovf16 0000 c1tr01con 0430 txen1 txabt1 txlarb1 txerr1 txreq1 rtren1 tx1pri<1:0> txen0 txabat0 txlarb0 txerr0 txreq0 rtren0 tx0pri<1:0> 0000 c1tr23con 0432 txen3 txabt3 txlarb3 txerr3 txreq3 rtren3 tx3pri<1:0> txen2 txabat2 txlarb2 txerr2 txreq2 rtren2 tx2pri<1:0> 0000 c1tr45con 0434 txen5 txabt5 txlarb5 txerr5 txreq5 rtren5 tx5pri<1:0> txen4 txabat4 txlarb4 txerr4 txreq4 rtren4 tx4pri<1:0> 0000 c1tr67con 0436 txen7 txabt7 txlarb7 txerr7 txreq7 rtren7 tx7pri<1:0> txen6 txabat6 txlarb6 txerr6 txreq6 rtren6 tx6pri<1:0> xxxx c1rxd 0440 received data word xxxx c1txd 0442 transmit data word xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 49 dspic33fjxxxgpx06/x08/x10 table 3-18: ecan1 register map when c1ctrl1.win = 1 file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets 0400- 041e see definition when win = x c1bufpnt1 0420 f3bp<3:0> f2bp<3:0> f1bp<3:0> f0bp<3:0> 0000 c1bufpnt2 0422 f7bp<3:0> f6bp<3:0> f5bp<3:0> f4bp<3:0> 0000 c1bufpnt3 0424 f11bp<3:0> f10bp<3:0> f9bp<3:0> f8bp<3:0> 0000 c1bufpnt4 0426 f15bp<3:0> f14bp<3:0> f13bp<3:0> f12bp<3:0> 0000 c1rxm0sid 0430 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c1rxm0eid 0432 eid<15:8> eid<7:0> xxxx c1rxm1sid 0434 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c1rxm1eid 0436 eid<15:8> eid<7:0> xxxx c1rxm2sid 0438 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c1rxm2eid 043a eid<15:8> eid<7:0> xxxx c1rxf0sid 0440 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf0eid 0442 eid<15:8> eid<7:0> xxxx c1rxf1sid 0444 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf1eid 0446 eid<15:8> eid<7:0> xxxx c1rxf2sid 0448 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf2eid 044a eid<15:8> eid<7:0> xxxx c1rxf3sid 044c sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf3eid 044e eid<15:8> eid<7:0> xxxx c1rxf4sid 0450 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf4eid 0452 eid<15:8> eid<7:0> xxxx c1rxf5sid 0454 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf5eid 0456 eid<15:8> eid<7:0> xxxx c1rxf6sid 0458 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf6eid 045a eid<15:8> eid<7:0> xxxx c1rxf7sid 045c sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf7eid 045e eid<15:8> eid<7:0> xxxx c1rxf8sid 0460 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf8eid 0462 eid<15:8> eid<7:0> xxxx c1rxf9sid 0464 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf9eid 0466 eid<15:8> eid<7:0> xxxx c1rxf10sid 0468 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf10eid 046a eid<15:8> eid<7:0> xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 50 ? 2007 microchip technology inc. c1rxf11sid 046c sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf11eid 046e eid<15:8> eid<7:0> xxxx c1rxf12sid 0470 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf12eid 0472 eid<15:8> eid<7:0> xxxx c1rxf13sid 0474 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf13eid 0476 eid<15:8> eid<7:0> xxxx c1rxf14sid 0478 sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf14eid 047a eid<15:8> eid<7:0> xxxx c1rxf15sid 047c sid<10:3> sid<2:0> ?exide ?eid<17:16> xxxx c1rxf15eid 047e eid<15:8> eid<7:0> xxxx table 3-18: ecan1 register map when c1ctrl1.win = 1 (continued) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 51 dspic33fjxxxgpx06/x08/x10 table 3-19: ecan2 register map when c2ctrl1.win = 0 or 1 file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets c2ctrl1 0500 ? ? csidl abat cancks reqop<2:0> opmode<2:0> ? cancap ? ?win 0480 c2ctrl2 0502 ? ? ? ? ? ? ? ? ? ? ? dncnt<4:0> 0000 c2vec 0504 ? ? ? filhit<4:0> ?icode<6:0> 0000 c2fctrl 0506 dmabs<2:0> ? ? ? ? ? ? ? ? fsa<4:0> 0000 c2fifo 0508 ? ?fbp<5:0> ? ? fnrb<5:0> 0000 c2intf 050a ? ? txbo txbp rxbp txwar rxwar ewarn ivrif wakif errif ? fifoif rbovif rbif tbif 0000 c2inte 050c ? ? ? ? ? ? ? ? ivrie wakie errie ? fifoie rbovie rbie tbie 0000 c2ec 050e terrcnt<7:0> rerrcnt<7:0> 0000 c2cfg1 0510 ? ? ? ? ? ? ? ? sjw<1:0> brp<5:0> 0000 c2cfg2 0512 ? wakfil ? ? ? seg2ph<2:0> seg2phts sam seg1ph<2:0> prseg<2:0> 0000 c2fen1 0514 flten15 flten14 flten13 flten12 flten11 flten10 flten9 flten8 flten7 flten6 flten5 flten4 flten3 flten2 flten1 flten0 0000 c2fmsksel1 0518 f7msk<1:0> f6msk<1:0> f5msk<1:0> f4m sk<1:0> f3msk<1:0> f2msk<1:0> f1msk<1:0> f0msk<1:0> 0000 c2fmsksel2 051a f15msk<1:0> f14msk<1:0> f13msk<1:0> f12msk <1:0> f11msk<1:0> f10msk<1:0> f9msk<1:0> f8msk<1:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 3-20: ecan2 register map when c2ctrl1.win = 0 file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets 0500- 051e see definition when win = x c2rxful1 0520 rxful15 rxful14 rxful13 rxful12 rxful11 rxful10 rxful9 rxful8 rxful7 rxful6 rxful5 rxful4 rxful3 rxful2 rxful1 rxful0 0000 c2rxful2 0522 rxful31 rxful30 rxful29 rxful28 rxful27 rxful26 rxful25 rxful24 rxful23 rxful22 rxful21 rxful20 rxful19 rxful18 rxful17 rxful16 0000 c2rxovf1 0528 rxovf15 rxovf14 rxovf13 rxovf12 rxovf11 rxovf10 rxov f09 rxovf08 rxovf7 rxovf6 rxovf5 rx ovf4 rxovf3 rxov f2 rxovf1 rxovf0 0000 c2rxovf2 052a rxovf31 rxovf30 rxovf29 rxovf28 rxovf27 rxovf26 rxovf25 rxovf24 rxovf23 rxovf22 rxovf21 rxovf20 rxovf19 rxovf18 rxovf17 rxovf16 0000 c2tr01con 0530 txen1 tx abat1 tx larb1 tx err1 tx req1 rtren1 tx1pri<1:0> txen0 tx abat0 tx larb0 tx err0 tx req0 rtren0 tx0pri<1:0> 0000 c2tr23con 0532 txen3 tx abat3 tx larb3 tx err3 tx req3 rtren3 tx3pri<1:0> txen2 tx abat2 tx larb2 tx err2 tx req2 rtren2 tx2pri<1:0> 0000 c2tr45con 0534 txen5 tx abat5 tx larb5 tx err5 tx req5 rtren5 tx5pri<1:0> txen4 tx abat4 tx larb4 tx err4 tx req4 rtren4 tx4pri<1:0> 0000 c2tr67con 0536 txen7 tx abat7 tx larb7 tx err7 tx req7 rtren7 tx7pri<1:0> txen6 tx abat6 tx larb6 tx err6 tx req6 rtren6 tx6pri<1:0> xxxx c2rxd 0540 recieved data word xxxx c2txd 0542 transmit data word xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 52 ? 2007 microchip technology inc. table 3-21: ecan2 register map when c2ctrl1.win = 1 file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets 0500 - 051e see definition when win = x c2bufpnt1 0520 f3bp<3:0> f2bp<3:0> f1bp<3:0> f0bp<3:0> 0000 c2bufpnt2 0522 f7bp<3:0> f6bp<3:0> f5bp<3:0> f4bp<3:0> 0000 c2bufpnt3 0524 f11bp<3:0> f10bp<3:0> f9bp<3:0> f8bp<3:0> 0000 c2bufpnt4 0526 f15bp<3:0> f14bp<3:0> f13bp<3:0> f12bp<3:0> 0000 c2rxm0sid 0530 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c2rxm0eid 0532 eid<15:8> eid<7:0> xxxx c2rxm1sid 0534 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c2rxm1eid 0536 eid<15:8> eid<7:0> xxxx c2rxm2sid 0538 sid<10:3> sid<2:0> ?mide ?eid<17:16> xxxx c2rxm2eid 053a eid<15:8> eid<7:0> xxxx c2rxf0sid 0540 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c2rxf0eid 0542 eid<15:8> eid<7:0> xxxx c2rxf1sid 0544 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c2rxf1eid 0546 eid<15:8> eid<7:0> xxxx c2rxf2sid 0548 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c2rxf2eid 054a eid<15:8> eid<7:0> xxxx c2rxf3sid 054c sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c2rxf3eid 054e eid<15:8> eid<7:0> xxxx c2rxf4sid 0550 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c2rxf4eid 0552 eid<15:8> eid<7:0> xxxx c2rxf5sid 0554 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c2rxf5eid 0556 eid<15:8> eid<7:0> xxxx c2rxf6sid 0558 sid<10:3> sid<2:0> ? exide ?eid<17:16> xxxx c2rxf6eid 055a eid<15:8> eid<7:0> xxxx c2rxf7sid 055c sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx c2rxf7eid 055e eid<15:8> eid<7:0> xxxx c2rxf8sid 0560 sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx c2rxf8eid 0562 eid<15:8> eid<7:0> xxxx c2rxf9sid 0564 sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx c2rxf9eid 0566 eid<15:8> eid<7:0> xxxx c2rxf10sid 0568 sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 53 dspic33fjxxxgpx06/x08/x10 c2rxf10eid 056a eid<15:8> eid<7:0> xxxx c2rxf11sid 056c sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx c2rxf11eid 056e eid<15:8> eid<7:0> xxxx c2rxf12sid 0570 sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx c2rxf12eid 0572 eid<15:8> eid<7:0> xxxx c2rxf13sid 0574 sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx c2rxf13eid 0576 eid<15:8> eid<7:0> xxxx c2rxf14sid 0578 sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx c2rxf14eid 057a eid<15:8> eid<7:0> xxxx c2rxf15sid 057c sid<10:3 sid<2:0> ? exide ?eid<17:16> xxxx c2rxf15eid 057e eid<15:8> eid<7:0> xxxx table 3-21: ecan2 register map when c2ctrl1.win = 1 (continued) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 54 ? 2007 microchip technology inc. table 3-22: dci register map sfr name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reset state dcicon1 0280 dcien ? dcisidl ? dloop csckd cscke cofsd unfm csdom djst ? ? ? cofsm1 cofsm0 0000 0000 0000 0000 dcicon2 0282 ? ? ? ? blen1 blen0 ? cofsg<3:0> ?ws<3:0> 0000 0000 0000 0000 dcicon3 0284 ? ? ? ?bcg<11:0> 0000 0000 0000 0000 dcistat 0286 ? ? ? ? slot3 slot2 slot1 slot0 ? ? ? ? rov rful tunf tmpty 0000 0000 0000 0000 tscon 0288 tse15 tse14 tse13 tse12 tse11 tse10 tse9 tse8 tse7 tse6 tse5 tse4 tse3 tse2 tse1 tse0 0000 0000 0000 0000 rscon 028c rse15 rse14 rse13 rse12 rse11 rse10 rse9 rse8 rse7 rse6 rse5 rse4 rse3 rse2 rse1 rse0 0000 0000 0000 0000 rxbuf0 0290 receive buffer #0 data register 0000 0000 0000 0000 rxbuf1 0292 receive buffer #1 data register 0000 0000 0000 0000 rxbuf2 0294 receive buffer #2 data register 0000 0000 0000 0000 rxbuf3 0296 receive buffer #3 data register 0000 0000 0000 0000 txbuf0 0298 transmit buffer #0 data register 0000 0000 0000 0000 txbuf1 029a transmit buffer #1 data register 0000 0000 0000 0000 txbuf2 029c transmit buffer #2 data register 0000 0000 0000 0000 txbuf3 029e transmit buffer #3 data register 0000 0000 0000 0000 legend: ? = unimplemented, read as ? 0 ?. note 1: refer to the ?dspic33f family reference manual? for descriptions of register bit fields. table 3-23: porta register map (1) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 02c0 trisa15 trisa14 trisa13 trisa12 ? trisa10 trisa9 ? trisa7 trisa6 trisa5 trisa4 trisa3 trisa2 trisa1 trisa0 d6c0 porta 02c2 ra15 ra14 ra13 ra12 ? ra10 ra9 ? ra7 ra6 ra5 ra4 ra3 ra2 ra1 ra0 xxxx lata 02c4 lata15 lata14 lata13 lata12 ? lata10 lata9 ? lata7 lata6 lata5 lata4 lata3 lata2 lata1 lata0 xxxx odca (2) 06c0 odca15 odca14 odca13 odca12 ? ? ? ? ? ? odca5 odca4 odca3 odca2 odca1 odca0 xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal for pinhigh devices. note 1: the actual set of i/o port pins varies from one device to another. please refer to the corresponding pinout diagrams. table 3-24: portb register map (1) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 02c6 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 trisb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 02c8 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 02ca latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal for pinhigh devices. note 1: the actual set of i/o port pins varies from one device to another. please refer to the corresponding pinout diagrams.
? 2007 microchip technology inc. ds70286a-page 55 dspic33fjxxxgpx06/x08/x10 table 3-25: portc register map (1) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisc 02cc trisc15 trisc14 trisc13 trisc12 ? ? ? ? ? ? ? trisc4 trisc3 trisc2 trisc1 ? f01e portc 02ce rc15 rc14 rc13 rc12 ? ? ? ? ? ? ? rc4 rc3 rc2 rc1 ? xxxx latc 02d0 latc15 latc14 latc13 latc12 ? ? ? ? ? ? ? latc4 latc3 latc2 latc1 ? xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal for pinhigh devices. note 1: the actual set of i/o port pins varies from one device to another. please refer to the corresponding pinout diagrams. table 3-26: portd register map (1) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisd 02d2 trisd15 trisd14 trisd13 trisd12 trisd11 trisd10 trisd9 trisd8 trisd7 trisd6 trisd5 trisd4 trisd3 trisd2 trisd1 trisd0 ffff portd 02d4 rd15 rd14 rd13 rd12 rd11 rd10 rd9 rd8 rd7 rd6 rd5 rd4 rd3 rd2 rd1 rd0 xxxx latd 02d6 latd15 latd14 latd13 latd12 latd11 latd10 latd9 latd8 latd7 latd6 latd5 latd4 latd3 latd2 latd1 latd0 xxxx odcd 06d2 odcd15 odcd14 odcd13 odcd12 odcd11 odcd10 odcd9 odcd8 odcd7 odcd6 odcd5 odcd4 odcd3 odcd2 odcd1 odcd0 xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal for pinhigh devices. note 1: the actual set of i/o port pins varies from one device to another. please refer to the corresponding pinout diagrams. table 3-27: porte register map (1) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trise 02d8 ? ? ? ? ? ? ? ? trise7 trise6 trise5 trise4 trise3 trise2 trise1 trise0 03ff porte 02da ? ? ? ? ? ? ? ? re7 re6 re5 re4 re3 re2 re1 re0 xxxx late 02dc ? ? ? ? ? ? ? ? late7 late6 late5 late4 late3 late2 late1 late0 xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal for pinhigh devices. note 1: the actual set of i/o port pins varies from one device to another. please refer to the corresponding pinout diagrams. table 3-28: portf register map (1) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisf 02de ? ? trisf13 trisf12 ? ? ? trisf8 trisf7 trisf6 trisf5 trisf4 trisf3 trisf2 trisf1 trisf0 31ff portf 02e0 ? ? rf13 rf12 ? ? ? rf8 rf7 rf6 rf5 rf4 rf3 rf2 rf1 rf0 xxxx latf 02e2 ? ? latf13 latf12 ? ? ? latf8 latf7 latf6 latf5 latf4 latf3 latf2 latf1 latf0 xxxx odcf 06de ? ? odcf13 odcf12 ? ? ? odcf8 odcf7 odcf6 odcf5 odcf4 odcf3 odcf2 odcf1 odcf0 xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal for pinhigh devices. note 1: the actual set of i/o port pins varies from one device to another. please refer to the corresponding pinout diagrams.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 56 ? 2007 microchip technology inc. table 3-29: portg register map (1) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisg 02e4 trisg15 trisg14 trisg13 trisg12 ? ? trisg9 trisg8 trisg7 trisg6 ? ? trisg3 trisg2 trisg1 trisg0 f3cf portg 02e6 rg15 rg14 rg13 rg12 ? ? rg9 rg8 rg7 rg6 ? ?rg3rg2rg1rg0 xxxx latg 02e8 latg15 latg14 latg13 latg12 ? ? latg9 latg8 latg7 latg6 ? ? latg3 latg2 latg1 latg0 xxxx odcg 06e4 odcg15 odcg14 odcg13 odcg12 ? ? odcg9 odcg8 odcg7 odcg6 ? ? odcg3 odcg2 odcg1 odcg0 xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal for pinhigh devices. note 1: the actual set of i/o port pins varies from one device to another. please refer to the corresponding pinout diagrams. table 3-30: system control register map file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rcon 0740 trapr iopuwr ? ? ? ? ? vregs extr swr swdten wdto sleep idle bor por xxxx (1) osccon 0742 ?cosc<2:0> ? nosc<2:0> clklock ?lock ?cf ? lposcen oswen 0300 (2) clkdiv 0744 roi doze<2:0> dozen frcdiv<2:0> pllpost<1:0> ? pllpre<4::0> 0040 pllfbd 0746 ? ? ? ? ? ? ? plldiv<8:0> 0030 osctun 0748 ? ? ? ? ? ? ? ? ? ? tun<5:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. note 1: rcon register reset values dependent on type of reset. 2: osccon register reset values dependent on the fosc configuration bits and by type of reset. table 3-31: nvm register map file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets nvmcon 0760 wr wren wrerr ? ? ? ? ? ? erase ? ?nvmop<3:0> 0000 (1) nvmkey 0766 ? ? ? ? ? ? ? ? nvmkey<7:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. note 1: reset value shown is for por only. value on other reset states is dependent on the state of memory write or erase operations at the time of reset. table 3-32: pmd register map file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0770 t5md t4md t3md t2md t1md qeimd pwmmd dcimd i2c1md u2md u1md spi2md spi1md c2md c1md ad1md 0000 pmd2 0772 ic8md ic7md ic6md ic5md ic4md ic3md ic2md ic1md oc8md oc7md oc6md oc5md oc4md oc3md oc2md oc1md 0000 pmd3 0774 t9md t8md t7md t6md ? ? ? ? ? ? ? ? ? ?i2c2mdad2md 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2007 microchip technology inc. ds70286a-page 57 dspic33fjxxxgpx06/x08/x10 3.2.7 software stack in addition to its use as a working register, the w15 register in the dspic33fjxxxgpx06/x08/x10 devices is also used as a software stack pointer. the stack pointer always points to the first available free word and grows from lower to higher addresses. it pre-dec- rements for stack pops and post-increments for stack pushes, as shown in figure 3-6. for a pc push during any call instruction, the msb of the pc is zero-extended before the push, ensuring that the msb is always clear. the stack pointer limit register (splim) associated with the stack pointer sets an upper address boundary for the stack. splim is uninitialized at reset. as is the case for the stack pointer, splim<0> is forced to ? 0 ? because all stack operations must be word-aligned. whenever an ea is generated using w15 as a source or destination pointer, the resulting address is compared with the value in splim. if the contents of the stack pointer (w15) and the splim register are equal and a push operation is performed, a stack error trap will not occur. the stack error trap will occur on a subsequent push operation. thus, for example, if it is desirable to cause a stack error trap when the stack grows beyond address 0x2000 in ram, initialize the splim with the value 0x1ffe. similarly, a stack pointer underflow (stack error) trap is generated when the stack pointer address is found to be less than 0x0800. this prevents the stack from interfering with the special function register (sfr) space. a write to the splim register should not be immediately followed by an indirect read operation using w15. figure 3-6: call stack frame 3.2.8 data ram protection feature the dspic33f product family supports data ram protection features which enable segments of ram to be protected when used in conjunction with boot and secure code segment security. bsram (secure ram segment for bs) is accessible only from the boot segment flash code when enabled. ssram (secure ram segment for ram) is accessible only from the secure segment flash code when enabled. see table 3-1 for an overview of the bsram and ssram sfrs. 3.3 instruction addressing modes the addressing modes in table 3-33 form the basis of the addressing modes optimized to support the specific features of individual instructions. the addressing modes provided in the mac class of instructions are somewhat different from those in the other instruction types. 3.3.1 file register instructions most file register instructions use a 13-bit address field (f) to directly address data present in the first 8192 bytes of data memory (near data space). most file register instructions employ a working register, w0, which is denoted as wreg in these instructions. the destination is typically either the same file register or wreg (with the exception of the mul instruction), which writes the result to a register or register pair. the mov instruction allows additional flexibility and can access the entire data space. 3.3.2 mcu instructions the 3-operand mcu instructions are of the form: operand 3 = operand 1 operand 2 where operand 1 is always a working register (i.e., the addressing mode can only be register direct) which is referred to as wb. operand 2 can be a w register, fetched from data memory, or a 5-bit literal. the result location can be either a w register or a data memory location. the following addressing modes are supported by mcu instructions: ? register direct ? register indirect ? register indirect post-modified ? register indirect pre-modified ? 5-bit or 10-bit literal note: a pc push during exception processing concatenates the srl register to the msb of the pc prior to the push. pc<15:0> 000000000 0 15 w15 (before call ) w15 (after call ) stack grows towards higher address 0x0000 pc<22:16> pop : [--w15] push : [w15++] note: not all instructions support all the addressing modes given above. individual instructions may support different subsets of these addressing modes.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 58 ? 2007 microchip technology inc. table 3-33: fundamental addressing modes supported 3.3.3 move and accumulator instructions move instructions and the dsp accumulator class of instructions provide a greater degree of addressing flexibility than other instructions. in addition to the addressing modes supported by most mcu instruc- tions, move and accumulator instructions also support register indirect with register offset addressing mode, also referred to as register indexed mode. in summary, the following addressing modes are supported by move and accumulator instructions: ? register direct ? register indirect ? register indirect post-modified ? register indirect pre-modified ? register indirect with register offset (indexed) ? register indirect with literal offset ? 8-bit literal ? 16-bit literal 3.3.4 mac instructions the dual source operand dsp instructions ( clr , ed , edac , mac , mpy , mpy.n , movsac and msc ), also referred to as mac instructions, utilize a simplified set of addressing modes to allow the user to effectively manipulate the data pointers through register indirect tables. the 2-source operand prefetch registers must be members of the set {w8, w9, w10, w11}. for data reads, w8 and w9 are always directed to the x ragu and w10 and w11 will always be directed to the y agu. the effective addresses generated (before and after modification) must, therefore, be valid addresses within x data space for w8 and w9 and y data space for w10 and w11. in summary, the following addressing modes are supported by the mac class of instructions: ? register indirect ? register indirect post-modified by 2 ? register indirect post-modified by 4 ? register indirect post-modified by 6 ? register indirect with register offset (indexed) 3.3.5 other instructions besides the various addressing modes outlined above, some instructions use literal constants of various sizes. for example, bra (branch) instructions use 16-bit signed literals to specify the branch destination directly, whereas the disi instruction uses a 14-bit unsigned literal field. in some instructions, such as add acc , the source of an operand or result is implied by the opcode itself. certain operations, such as nop , do not have any operands. 3.4 modulo addressing modulo addressing mode is a method of providing an automated means to support circular data buffers using hardware. the objective is to remove the need for software to perform data address boundary checks when executing tightly looped code, as is typical in many dsp algorithms. modulo addressing can operate in either data or program space (since the data pointer mechanism is essentially the same for both). one circular buffer can be supported in each of the x (which also provides the pointers into program space) and y data spaces. modulo addressing addressing mode description file register direct the address of the file register is specified explicitly. register direct the contents of a register are accessed directly. register indirect the contents of wn forms the ea. register indirect post-modified the contents of wn forms the ea. wn is post-modified (incremented or decremented) by a constant value. register indirect pre-modified wn is pre-modified (incremented or decremented) by a signed constant value to form the ea. register indirect with register offset the sum of wn and wb forms the ea. register indirect with literal offset the sum of wn and a literal forms the ea. note: for the mov instructions, the addressing mode specified in the instruction can differ for the source and destination ea. however, the 4-bit wb (register offset) field is shared between both source and destination (but typically only used by one). note: not all instructions support all the addressing modes given above. individual instructions may support different subsets of these addressing modes. note: register indirect with register offset addressing mode is only available for w9 (in x space) and w11 (in y space).
? 2007 microchip technology inc. ds70286a-page 59 dspic33fjxxxgpx06/x08/x10 can operate on any w register pointer. however, it is not advisable to use w14 or w15 for modulo addressing since these two registers are used as the stack frame pointer and stack pointer, respectively. in general, any particular circular buffer can only be configured to operate in one direction as there are certain restrictions on the buffer start address (for incre- menting buffers), or end address (for decrementing buffers), based upon the direction of the buffer. the only exception to the usage restrictions is for buffers which have a power-of-2 length. as these buffers satisfy the start and end address criteria, they may operate in a bidirectional mode (i.e., address boundary checks will be performed on both the lower and upper address boundaries). 3.4.1 start and end address the modulo addressing scheme requires that a starting and ending address be specified and loaded into the 16-bit modulo buffer addr ess registers: xmodsrt, xmodend, ymodsrt and ymodend (see table 3-1). the length of a circular buffer is not directly specified. it is determined by the difference between the corresponding start and end addresses. the maximum possible length of the circular buffer is 32k words (64 kbytes). 3.4.2 w address register selection the modulo and bit-reversed addressing control register, modcon<15:0>, contains enable flags as well as a w register field to specify the w address registers. the xwm and ywm fields select which registers will operate with modulo addressing. if xwm = 15 , x ragu and x wagu modulo addressing is disabled. similarly, if ywm = 15 , y agu modulo addressing is disabled. the x address space pointer w register (xwm), to which modulo addressing is to be applied, is stored in modcon<3:0> (see table 3-1). modulo addressing is enabled for x data space when xwm is set to any value other than ? 15 ? and the xmoden bit is set at modcon<15>. the y address space pointer w register (ywm) to which modulo addressing is to be applied is stored in modcon<7:4>. modulo addressing is enabled for y data space when ywm is set to any value other than figure 3-7: modulo addressing operation example note: y space modulo addressing ea calcula- tions assume word sized data (lsb of every ea is always clear). 0x1100 0x1163 start addr = 0x1100 end addr = 0x1163 length = 0x0032 words byte address mov #0x1100, w0 mov w0, xmodsrt ;set modulo start address mov #0x1163, w0 mov w0, modend ;set modulo end address mov #0x8001, w0 mov w0, modcon ;enable w1, x agu for modulo mov #0x0000, w0 ;w0 holds buffer fill value mov #0x1110, w1 ;point w1 to buffer do again, #0x31 ;fill the 50 buffer locations mov w0, [w1++] ;fill the next location again: inc w0, w0 ;increment the fill value
dspic33fjxxxgpx06/x08/x10 ds70286a-page 60 ? 2007 microchip technology inc. 3.4.3 modulo addressing applicability modulo addressing can be applied to the effective address (ea) calculation associated with any w register. it is important to realize that the address boundaries check for addresses less than, or greater than, the upper (for incrementing buffers) and lower (for decrementing buffers) boundary addresses (not just equal to). address changes may, therefore, jump beyond boundaries and still be adjusted correctly. 3.5 bit-reversed addressing bit-reversed addressing mode is intended to simplify data re-ordering for radix-2 fft algorithms. it is supported by the x agu for data writes only. the modifier, which may be a constant value or register contents, is regarded as having its bit order reversed. the address source and destination are kept in normal order. thus, the only operand requiring reversal is the modifier. 3.5.1 bit-reversed addressing implementation bit-reversed addressing mode is enabled when: 1. bwm bits (w register selection) in the modcon register are any value other than ? 15 ? (the stack cannot be accessed using bit-reversed addressing). 2. the bren bit is set in the xbrev register. 3. the addressing mode used is register indirect with pre-increment or post-increment. if the length of a bit-reversed buffer is m = 2 n bytes, the last ?n? bits of the data buffer start address must be zeros. xb<14:0> is the bit-reversed address modifier, or ?pivot point?, which is typically a constant. in the case of an fft computation, its value is equal to half of the fft data buffer size. when enabled, bit-reversed addressing is only executed for register indirect with pre-increment or post-increment addressing and word sized data writes. it will not function for any other addressing mode or for byte sized data and normal addresses are generated instead. when bit-reversed addressing is active, the w address pointer is always added to the address modifier (xb) and the offset associated with the regis- ter indirect addressing mode is ignored. in addition, as word sized data is a requirement, the lsb of the ea is ignored (and always clear). if bit-reversed addressing has already been enabled by setting the bren (xbrev<15>) bit, then a write to the xbrev register should not be immediately followed by an indirect read operation using the w register that has been designated as the bit-reversed pointer. note: the modulo corrected effective address is written back to the register only when pre-modify or post-modify addressing mode is used to compute the effective address. when an address offset (e.g., [w7+w2]) is used, modulo address cor- rection is performed but the contents of the register remain unchanged. note: all bit-reversed ea calculations assume word sized data (lsb of every ea is always clear). the xb value is scaled accordingly to generate compatible (byte) addresses. note: modulo addressing and bit-reversed addressing should not be enabled together. in the event that the user attempts to do so, bit-reversed addressing will assume priority when active for the x wagu and x wagu modulo addressing will be disabled. however, modulo addressing will continue to function in the x ragu.
? 2007 microchip technology inc. ds70286a-page 61 dspic33fjxxxgpx06/x08/x10 figure 3-8: bit-reversed address example table 3-34: bit-reversed address sequence (16-entry) b3 b2 b1 0 b2 b3 b4 0 bit locations swapped left-to-right around center of binary value bit-reversed address xb = 0x0008 for a 16-word bit-reversed buffer b7 b6 b5 b1 b7 b6 b5 b4 b11 b10 b9 b8 b11 b10 b9 b8 b15 b14 b13 b12 b15 b14 b13 b12 sequential address pivot point normal address bit-reversed address a3 a2 a1 a0 decimal a3 a2 a1 a0 decimal 0000 0 0000 0 0001 1 1000 8 0010 2 0100 4 0011 3 1100 12 0100 4 0010 2 0101 5 1010 10 0110 6 0110 6 0111 7 1110 14 1000 8 0001 1 1001 9 1001 9 1010 10 0101 5 1011 11 1101 13 1100 12 0011 3 1101 13 1011 11 1110 14 0111 7 1111 15 1111 15
dspic33fjxxxgpx06/x08/x10 ds70286a-page 62 ? 2007 microchip technology inc. 3.6 interfacing program and data memory spaces the dspic33fjxxxgpx06/x08/x10 architecture uses a 24-bit wide program space and a 16-bit wide data space. the architecture is also a modified harvard scheme, meaning that data can also be present in the program space. to use this data successfully, it must be accessed in a way that preserves the alignment of information in both spaces. aside from normal execution, the dspic33fjxxxgpx06/x08/x10 architecture provides two methods by which program space can be accessed during operation: ? using table instructions to access individual bytes or words anywhere in the program space ? remapping a portion of the program space into the data space (program space visibility) table instructions allow an application to read or write to small areas of the program memory. this capability makes the method ideal for accessing data tables that need to be updated from time to time. it also allows access to all bytes of the program word. the remap- ping method allows an application to access a large block of data on a read-only basis, which is ideal for look ups from a large table of static data. it can only access the least significant word of the program word. 3.6.1 addressing program space since the address ranges for the data and program spaces are 16 and 24 bits, respectively, a method is needed to create a 23-bit or 24-bit program address from 16-bit data registers. the solution depends on the interface method to be used. for table operations, the 8-bit table page register (tblpag) is used to define a 32k word region within the program space. this is concatenated with a 16-bit ea to arrive at a full 24-bit program space address. in this format, the most significant bit of tblpag is used to determine if the operation occurs in the user memory (tblpag<7> = 0 ) or the configuration memory (tblpag<7> = 1 ). for remapping operations, the 8-bit program space visibility register (psvpag) is used to define a 16k word page in the program space. when the most significant bit of the ea is ? 1 ?, psvpag is concatenated with the lower 15 bits of the ea to form a 23-bit program space address. unlike table operations, this limits remapping operations strictly to the user memory area. table 3-35 and figure 3-9 show how the program ea is created for table operations and remapping accesses from the data ea. here, p<23:0> refers to a program space word, whereas d<15:0> refers to a data space word. table 3-35: program space address construction access type access space program space address <23> <22:16> <15> <14:1> <0> instruction access (code execution) user 0 pc<22:1> 0 0xx xxxx xxxx xxxx xxxx xxx0 tblrd/tblwt (byte/word read/write) user tblpag<7:0> data ea<15:0> 0xxx xxxx xxxx xxxx xxxx xxxx configuration tblpag<7:0> data ea<15:0> 1xxx xxxx xxxx xxxx xxxx xxxx program space visibility (block remap/read) user 0 psvpag<7:0> data ea<14:0> (1) 0 xxxx xxxx xxx xxxx xxxx xxxx note 1: data ea<15> is always ? 1 ? in this case, but is not used in calculating the program space address. bit 15 of the address is psvpag<0>.
? 2007 microchip technology inc. ds70286a-page 63 dspic33fjxxxgpx06/x08/x10 figure 3-9: data access from program space address generation 0 program counter 23 bits 1 psvpag 8 bits ea 15 bits program counter (1) select tblpag 8 bits ea 16 bits byte select 0 0 1/0 user/configuration table operations (2) program space visibility (1) space select 24 bits 23 bits (remapping) 1/0 0 note 1: the lsb of program space addresses is always fixed as ? 0 ? in order to maintain word alignment of data in the program and data spaces. 2: table operations are not required to be word-aligned. table read operations are permitted in the configuration memory space.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 64 ? 2007 microchip technology inc. 3.6.2 data access from program memory using table instructions the tblrdl and tblwtl instructions offer a direct method of reading or writing the lower word of any address within the program space without going through data space. the tblrdh and tblwth instructions are the only method to read or write the upper 8 bits of a program space word as data. the pc is incremented by two for each successive 24-bit program word. this allows program memory addresses to directly map to data space addresses. program memory can thus be regarded as two 16-bit word wide address spaces, residing side by side, each with the same address range. tblrdl and tblwtl access the space which contains the least significant data word and tblrdh and tblwth access the space which contains the upper data byte. two table instructions are provided to move byte or word sized (16-bit) data to and from program space. both function as either byte or word operations. 1. tblrdl (table read low): in word mode, it maps the lower word of the program space location (p<15:0>) to a data address (d<15:0>). in byte mode, either the upper or lower byte of the lower program word is mapped to the lower byte of a data address. the upper byte is selected when byte select is ? 1 ?; the lower byte is selected when it is ? 0 ?. 2. tblrdh ( table read high): in word mode, it maps the entire upper word of a program address (p<23:16>) to a data address. note that d<15:8>, the ?phantom byte?, will always be ? 0 ?. in byte mode, it maps the upper or lower byte of the program word to d<7:0> of the data address, as above. note that the data will always be ? 0 ? when the upper ?phantom? byte is selected (byte select = 1 ). in a similar fashion, two table instructions, tblwth and tblwtl , are used to write individual bytes or words to a program space address. the details of their operation are explained in section 4.0 ?flash program memory? . for all table operations, the area of program memory space to be accessed is determined by the table page register (tblpag). tblpag covers the entire program memory space of the device, including user and config- uration spaces. when tblpag<7> = 0 , the table page is located in the user memory space. when tblpag<7> = 1 , the page is located in configuration space. figure 3-10: accessing program memory with table instructions 0 8 16 23 00000000 00000000 00000000 00000000 ?phantom? byte tblrdh.b (wn<0> = 0 ) tblrdl.w tblrdl.b (wn<0> = 1 ) tblrdl.b (wn<0> = 0 ) 23 15 0 tblpag 02 0x000000 0x800000 0x020000 0x030000 program space the address for the table operation is determined by the data ea within the page defined by the tblpag register. only read operations are shown; write operations are also valid in the user memory area.
? 2007 microchip technology inc. ds70286a-page 65 dspic33fjxxxgpx06/x08/x10 3.6.3 reading data from program memory using program space visibility the upper 32 kbytes of data space may optionally be mapped into any 16k word page of the program space. this option provides transparent access of stored con- stant data from the data space without the need to use special instructions (i.e., tblrdl/h ). program space access through the data space occurs if the most significant bit of the data space ea is ? 1 ? and program space visibility is enabled by setting the psv bit in the core control register (corcon<2>). the location of the program memory space to be mapped into the data space is determined by the program space visibility page register (psvpag). this 8-bit register defines any one of 256 possible pages of 16k words in program space. in effect, psvpag functions as the upper 8 bits of the program memory address, with the 15 bits of the ea functioning as the lower bits. note that by incrementing the pc by 2 for each program memory word, the lower 15 bits of data space addresses directly map to the lower 15 bits in the corresponding program space addresses. data reads to this area add an additional cycle to the instruction being executed, since two program memory fetches are required. although each data space address, 8000h and higher, maps directly into a corresponding program memory address (see figure 3-11), only the lower 16 bits of the 24-bit program word are used to contain the data. the upper 8 bits of any program space location used as data should be programmed with ? 1111 1111 ? or ? 0000 0000 ? to force a nop . this prevents possible issues should the area of code ever be accidentally executed. for operations that use psv and are executed outside a repeat loop, the mov and mov.d instructions require one instruction cycle in addition to the specified execution time. all other instructions require two instruction cycles in addition to the specified execution time. for operations that use psv, which are executed inside a repeat loop, there will be some instances that require two instruction cycles in addition to the specified execution time of the instruction: ? execution in the first iteration ? execution in the last iteration ? execution prior to exiting the loop due to an interrupt ? execution upon re-entering the loop after an interrupt is serviced any other iteration of the repeat loop will allow the instruction accessing data, using psv, to execute in a single cycle. figure 3-11: program space visibility operation note: psv access is temporarily disabled during table reads/writes. 23 15 0 psvpag data space program space 0x0000 0x8000 0xffff 02 0x000000 0x800000 0x010000 0x018000 when corcon<2> = 1 and ea<15> = 1 : the data in the page designated by psvpag is mapped into the upper half of the data memory space... data ea<14:0> ...while the lower 15 bits of the ea specify an exact address within the psv area. this corresponds exactly to the same lower 15 bits of the actual program space address. psv area
dspic33fjxxxgpx06/x08/x10 ds70286a-page 66 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 67 dspic33fjxxxgpx06/x08/x10 4.0 flash program memory the dspic33fjxxxgpx06/x08/x10 devices contain internal flash program memory for storing and execut- ing application code. the memory is readable, writable and erasable during normal operation over the entire v dd range. flash memory can be programmed in two ways: 1. in-circuit serial programming? (icsp?) programming capability 2. run-time self-programming (rtsp) icsp allows a dspic33fjxxxgpx06/x08/x10 device to be serially programmed while in the end application circuit. this is simply done with two lines for program- ming clock and programming data (one of the alternate programming pin pairs: pgc1/pgd1, pgc2/pgd2 or pgc3/pgd3), and three other lines for power (v dd ), ground (v ss ) and master clear (mclr ). this allows customers to manufacture boards with unprogrammed devices and then program the digital signal controller just before shipping the product. this also allows the most recent firmware or a custom firmware to be pro- grammed. rtsp is accomplished using tblrd (table read) and tblwt (table write) instructions. with rtsp, the user can write program memory data either in blocks or ?rows? of 64 instructions (192 bytes) at a time or a single program memory word, and erase program memory in blocks or ?pages? of 512 instructions (1536 bytes) at a time. 4.1 table instructions and flash programming regardless of the method used, all programming of flash memory is done with the table read and table write instructions. these allow direct read and write access to the program memory space from the data memory while the device is in normal operating mode. the 24-bit target address in the program memory is formed using bits<7:0> of the tblpag register and the effective address (ea) from a w register specified in the table instruction, as shown in figure 4-1. the tblrdl and the tblwtl instructions are used to read or write to bits<15:0> of program memory. tblrdl and tblwtl can access program memory in both word and byte modes. the tblrdh and tblwth instructions are used to read or write to bits<23:16> of program memory. tblrdh and tblwth can also access program memory in word or byte mode. figure 4-1: addressing for table registers note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the lat- est dspic33f family reference manual sections. 0 program counter 24 bits program counter tblpag reg 8 bits working reg ea 16 bits byte 24-bit ea 0 1/0 select using table instruction using user/configuration space select
dspic33fjxxxgpx06/x08/x10 ds70286a-page 68 ? 2007 microchip technology inc. 4.2 rtsp operation the dspic33fjxxxgpx06/x08/x10 flash program memory array is organized into rows of 64 instructions or 192 bytes. rtsp allows the user to erase a page of memory, which consists of eight rows (512 instructions) at a time, and to program one row or one word at a time. table 24-12, dc characteristics: program memory shows typical erase and programming times. the 8-row erase pages and single row write rows are edge-aligned, from the beginning of program memory, on boundaries of 1536 bytes and 192 bytes, respec- tively. the program memory implements holding buffers that can contain 64 instructions of programming data. prior to the actual programming operation, the write data must be loaded into the buffers in sequential order. the instruction words loaded must always be from a group of 64 boundary. the basic sequence for rtsp programming is to set up a table pointer, then do a series of tblwt instructions to load the buffers. programming is performed by set- ting the control bits in the nvmcon register. a total of 64 tblwtl and tblwth instructions are required to load the instructions. all of the table write operations are single-word writes (two instruction cycles) because only the buffers are written. a programming cycle is required for programming each row. 4.3 control registers there are two sfrs used to read and write the program flash memory: ? nvmcon: flash memory control register ? nvmkey: non-volatile memory key register the nvmcon register (register 4-1) controls which blocks are to be erased, which memory type is to be programmed and the start of the programming cycle. nvmkey (register 4-2) is a write-only register that is used for write protection. to start a programming or erase sequence, the user must consecutively write 55h and aah to the nvmkey register. refer to section 4.4 ?programming operations? for further details. 4.4 programming operations a complete programming sequence is necessary for programming or erasing the internal flash in rtsp mode. a programming operation is nominally 4 ms in duration and the processor stalls (waits) until the oper- ation is finished. setting the wr bit (nvmcon<15>) starts the operation, and the wr bit is automatically cleared when the operation is finished.
? 2007 microchip technology inc. ds70286a-page 69 dspic33fjxxxgpx06/x08/x10 register 4-1: nvmcon: flash memory control register r/so-0 (1) r/w-0 (1) r/w-0 (1) u-0 u-0 u-0 u-0 u-0 wr wren wrerr ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 (1) u-0 u-0 r/w-0 (1) r/w-0 (1) r/w-0 (1) r/w-0 (1) ? erase ? ?nvmop<3:0> (2) bit 7 bit 0 legend: so = satiable only bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 wr: write control bit 1 = initiates a flash memory program or erase operation. the operation is self-timed and the bit is cleared by hardware once operation is complete. 0 = program or erase operation is complete and inactive bit 14 wren: write enable bit 1 = enable flash program/erase operations 0 = inhibit flash program/erase operations bit 13 wrerr: write sequence error flag bit 1 = an improper program or erase sequence attempt or termination has occurred (bit is set automatically on any set attempt of the wr bit) 0 = the program or erase operation completed normally bit 12-7 unimplemented: read as ? 0 ? bit 6 erase: erase/program enable bit 1 = perform the erase operation specified by nvmop<3:0> on the next wr command 0 = perform the program operation specified by nvmop<3:0> on the next wr command bit 5-4 unimplemented: read as ? 0 ? bit 3-0 nvmop<3:0>: nvm operation select bits (2) if erase = 1 : 1111 = memory bulk erase operation 1110 = reserved 1101 = erase general segment 1100 = erase secure segment 1011 = reserved 0011 = no operation 0010 = memory page erase operation 0001 = no operation 0000 = erase a single configuration register byte if erase = 0 : 1111 = no operation 1110 = reserved 1101 = no operation 1100 = no operation 1011 = reserved 0011 = memory word program operation 0010 = no operation 0001 = memory row program operation 0000 = program a single configuration register byte note 1: these bits can only be reset on por. 2: all other combinations of nvmop<3:0> are unimplemented.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 70 ? 2007 microchip technology inc. register 4-2: nvmkey: non-vo latile memory key register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 w-0 w-0 w-0 w-0 w-0 w-0 w-0 w-0 nvmkey<7:0> bit 7 bit 0 legend: so = satiable only bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 nvmkey<7:0>: key register (write only) bits
? 2007 microchip technology inc. ds70286a-page 71 dspic33fjxxxgpx06/x08/x10 4.4.1 programming algorithm for flash program memory the user can program one row of program flash memory at a time. to do this, it is necessary to erase the 8-row erase page that contains the desired row. the general process is: 1. read eight rows of program memory (512 instructions) and store in data ram. 2. update the program data in ram with the desired new data. 3. erase the block (see example 4-1): a) set the nvmop bits (nvmcon<3:0>) to ? 0010 ? to configure for block erase. set the erase (nvmcon<6>) and wren (nvm- con<14>) bits. b) write the starting address of the page to be erased into the tblpag and w registers. c) write 55h to nvmkey. d) write aah to nvmkey. e) set the wr bit (nvmcon<15>). the erase cycle begins and the cpu stalls for the dura- tion of the erase cycle. when the erase is done, the wr bit is cleared automatically. 4. write the first 64 instructions from data ram into the program memory buffers (see example 4-2). 5. write the program block to flash memory: a) set the nvmop bits to ? 0001 ? to configure for row programming. clear the erase bit and set the wren bit. b) write #0x55 to nvmkey. c) write #0xaa to nvmkey. d) set the wr bit. the programming cycle begins and the cpu stalls for the duration of the write cycle. when the write to flash mem- ory is done, the wr bit is cleared automatically. 6. repeat steps 4 and 5, using the next available 64 instructions from the block in data ram by incrementing the value in tblpag, until all 512 instructions are written back to flash memory. for protection against accidental operations, the write initiate sequence for nvmkey must be used to allow any erase or program operation to proceed. after the programming command has been executed, the user must wait for the programming time until programming is complete. the two instructions following the start of the programming sequence should be nop s, as shown in example 4-3. example 4-1: erasing a program memory page ; set up nvmcon for block erase operation mov #0x4042, w0 ; mov w0, nvmcon ; initialize nvmcon ; init pointer to row to be erased mov #tblpage(prog_addr), w0 ; mov w0, tblpag ; initialize pm page boundary sfr mov #tbloffset(prog_addr), w0 ; initialize in-page ea[15:0] pointer tblwtl w0, [w0] ; set base address of erase block disi #5 ; block all interrupts with priority <7 ; for next 5 instructions mov #0x55, w0 mov w0, nvmkey ; write the 55 key mov #0xaa, w1 ; mov w1, nvmkey ; write the aa key bset nvmcon, #wr ; start the erase sequence nop ; insert two nops after the erase nop ; command is asserted
dspic33fjxxxgpx06/x08/x10 ds70286a-page 72 ? 2007 microchip technology inc. example 4-2: loading the write buffers example 4-3: initiating a programming sequence ; set up nvmcon for row programming operations mov #0x4001, w0 ; mov w0, nvmcon ; initialize nvmcon ; set up a pointer to the first program memory location to be written ; program memory selected, and writes enabled mov #0x0000, w0 ; mov w0, tblpag ; initialize pm page boundary sfr mov #0x6000, w0 ; an example program memory address ; perform the tblwt instructions to write the latches ; 0th_program_word mov #low_word_0, w2 ; mov #high_byte_0, w3 ; tblwtl w2, [w0] ; write pm low word into program latch tblwth w3, [w0++] ; write pm high byte into program latch ; 1st_program_word mov #low_word_1, w2 ; mov #high_byte_1, w3 ; tblwtl w2, [w0] ; write pm low word into program latch tblwth w3, [w0++] ; write pm high byte into program latch ; 2nd_program_word mov #low_word_2, w2 ; mov #high_byte_2, w3 ; tblwtl w2, [w0] ; write pm low word into program latch tblwth w3, [w0++] ; write pm high byte into program latch ? ? ? ; 63rd_program_word mov #low_word_31, w2 ; mov #high_byte_31, w3 ; tblwtl w2, [w0] ; write pm low word into program latch tblwth w3, [w0++] ; write pm high byte into program latch disi #5 ; block all interrupts with priority <7 ; for next 5 instructions mov #0x55, w0 mov w0, nvmkey ; write the 55 key mov #0xaa, w1 ; mov w1, nvmkey ; write the aa key bset nvmcon, #wr ; start the erase sequence nop ; insert two nops after the nop ; erase command is asserted
? 2007 microchip technology inc. ds70286a-page 73 dspic33fjxxxgpx06/x08/x10 5.0 resets the reset module combines all reset sources and controls the device master reset signal, sysrst . the following is a list of device reset sources: ? por: power-on reset ? bor: brown-out reset ?mclr : master clear pin reset ?swr: reset instruction ? wdt: watchdog timer reset ? trapr: trap conflict reset ? iopuwr: illegal opcode and uninitialized w register reset a simplified block diagram of the reset module is shown in figure 5-1. any active source of reset will make the sysrst signal active. many registers associated with the cpu and peripherals are forced to a known reset state. most registers are unaffected by a reset; their status is unknown on por and unchanged by all other resets. all types of device reset will set a corresponding status bit in the rcon register to indicate the type of reset (see register 5-1). a por will clear all bits, except for the por bit (rcon<0>), that are set. the user can set or clear any bit at any time during code execution. the rcon bits only serve as status bits. setting a particular reset status bit in software does not cause a device reset to occur. the rcon register also has other bits associated with the watchdog timer and device power-saving states. the function of these bits is discussed in other sections of this manual. figure 5-1: reset sy stem block diagram note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note: refer to the specific peripheral or cpu section of this manual for register reset states. note: the status bits in the rcon register should be cleared after they are read so that the next rcon register value after a device reset will be meaningful. mclr v dd internal regulator bor sleep or idle reset instruction wdt module glitch filter trap conflict illegal opcode uninitialized w register sysrst v dd rise detect por
dspic33fjxxxgpx06/x08/x10 ds70286a-page 74 ? 2007 microchip technology inc. register 5-1: rcon: re set control register (1) r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 trapr iopuwr ? ? ? ? ?vregs bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-1 extr swr swdten (2) wdto sleep idle bor por bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 trapr: trap reset flag bit 1 = a trap conflict reset has occurred 0 = a trap conflict reset has not occurred bit 14 iopuwr: illegal opcode or uninitialized w access reset flag bit 1 = an illegal opcode detection, an illegal address mode or uninitialized w register used as an address pointer caused a reset 0 = an illegal opcode or uninitialized w reset has not occurred bit 13-9 unimplemented: read as ? 0 ? bit 8 vregs: voltage regulator standby during sleep bit 1 = voltage regulator is active during sleep 0 = voltage regulator goes into standby mode during sleep bit 7 extr: external reset (mclr ) pin bit 1 = a master clear (pin) reset has occurred 0 = a master clear (pin) reset has not occurred bit 6 swr: software reset (instruction) flag bit 1 = a reset instruction has been executed 0 = a reset instruction has not been executed bit 5 swdten: software enable/disable of wdt bit (2) 1 = wdt is enabled 0 = wdt is disabled bit 4 wdto: watchdog timer time-out flag bit 1 = wdt time-out has occurred 0 = wdt time-out has not occurred bit 3 sleep: wake-up from sleep flag bit 1 = device has been in sleep mode 0 = device has not been in sleep mode bit 2 idle: wake-up from idle flag bit 1 = device was in idle mode 0 = device was not in idle mode bit 1 bor: brown-out reset flag bit 1 = a brown-out reset has occurred 0 = a brown-out reset has not occurred note 1: all of the reset status bits may be set or cleared in software. setting one of these bits in software does not cause a device reset. 2: if the fwdten configuration bit is ? 1 ? (unprogrammed), the wdt is always enabled, regardless of the swdten bit setting.
? 2007 microchip technology inc. ds70286a-page 75 dspic33fjxxxgpx06/x08/x10 bit 0 por: power-on reset flag bit 1 = a power-up reset has occurred 0 = a power-up reset has not occurred register 5-1: rcon: re set control register (1) (continued) note 1: all of the reset status bits may be set or cleared in software. setting one of these bits in software does not cause a device reset. 2: if the fwdten configuration bit is ? 1 ? (unprogrammed), the wdt is always enabled, regardless of the swdten bit setting.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 76 ? 2007 microchip technology inc. table 5-1: reset flag bit operation 5.1 clock source selection at reset if clock switching is enabled, the system clock source at device reset is chosen, as shown in table 5-2. if clock switching is disabled, the system clock source is always selected according to the oscillator configuration bits. refer to section 8.0 ?oscillator configuration? for further details. table 5-2: oscillator selection vs. type of reset (clock switching enabled) 5.2 device reset times the reset times for various types of device reset are summarized in table 5-3. the system reset signal, sysrst , is released after the por and pwrt delay times expire. the time at which the device actually begins to execute code also depends on the system oscillator delays, which include the oscillator start-up timer (ost) and the pll lock time. the ost and pll lock times occur in parallel with the applicable sysrst delay times. the fscm delay determines the time at which the fscm begins to monitor the system clock source after the sysrst signal is released. flag bit setting event clearing event trapr (rcon<15>) trap conflict event por iopuwr (rcon<14>) illegal opcode or uninitialized w register access por extr (rcon<7>) mclr reset por swr (rcon<6>) reset instruction por wdto (rcon<4>) wdt time-out pwrsav instruction, por sleep (rcon<3>) pwrsav #sleep instruction por idle (rcon<2>) pwrsav #idle instruction por bor (rcon<1>) bor ? por (rcon<0>) por ? note: all reset flag bits may be set or cleared by the user software. reset type clock source determinant por oscillator configuration bits (fnosc<2:0>) bor mclr cosc control bits (osccon<14:12>) wdtr swr
? 2007 microchip technology inc. ds70286a-page 77 dspic33fjxxxgpx06/x08/x10 table 5-3: reset delay times for various device resets 5.2.1 por and long oscillator start-up times the oscillator start-up circuitry and its associated delay timers are not linked to the device reset delays that occur at power-up. some crystal circuits (especially low-frequency crystals) have a relatively long start-up time. therefore, one or more of the following conditions is possible after sysrst is released: ? the oscillator circuit has not begun to oscillate. ? the oscillator start-up timer has not expired (if a crystal oscillator is used). ? the pll has not achieved a lock (if pll is used). the device will not begin to execute code until a valid clock source has been released to the system. there- fore, the oscillator and pll start-up delays must be considered when the reset delay time must be known. 5.2.2 fail-safe clock monitor (fscm) and device resets if the fscm is enabled, it begins to monitor the system clock source when sysrst is released. if a valid clock source is not available at this time, the device auto- matically switches to the frc oscillator and the user can switch to the desired crystal oscillator in the trap service routine. 5.2.2.1 fscm delay for crystal and pll clock sources when the system clock source is provided by a crystal oscillator and/or the pll, a small delay, t fscm , is auto- matically inserted after the por and pwrt delay times. the fscm does not begin to monitor the system clock source until this delay expires. the fscm delay time is nominally 500 s and provides additional time for the oscillator and/or pll to stabilize. in most cases, the fscm delay prevents an oscillator failure trap at a device reset when the pwrt is disabled. reset type clock source sysrst delay system clock delay fscm delay notes por ec, frc, lprc t por + t startup + t rst ?? 1, 2, 3 ecpll, frcpll t por + t startup + t rst t lock t fscm 1, 2, 3, 5, 6 xt, hs, sosc t por + t startup + t rst t ost t fscm 1, 2, 3, 4, 6 xtpll, hspll t por + t startup + t rst t ost + t lock t fscm 1, 2, 3, 4, 5, 6 bor ec, frc, lprc t startup + t rst ?? 3 ecpll, frcpll t startup + t rst t lock t fscm 3, 5, 6 xt, hs, sosc t startup + t rst t ost t fscm 3, 4, 6 xtpll, hspll t startup + t rst t ost + t lock t fscm 3, 4, 5, 6 mclr any clock t rst ?? 3 wdt any clock t rst ?? 3 software any clock t rst ?? 3 illegal opcode any clock t rst ?? 3 uninitialized w any clock t rst ?? 3 trap conflict any clock t rst ?? 3 note 1: t por = power-on reset delay (10 s nominal). 2: t startup = conditional por delay of 20 s nominal (if on-chip regulator is enabled) or 64 ms nominal power-up timer delay (if regulator is disabled). t startup is also applied to all returns from powered-down states, including waking from sleep mode, only if the regulator is enabled. 3: t rst = internal state reset time (20 s nominal). 4: t ost = oscillator start-up timer. a 10-bit counter counts 1024 oscillator periods before releasing the oscillator clock to the system. 5: t lock = pll lock time (20 s nominal). 6: t fscm = fail-safe clock monitor delay (100 s nominal).
dspic33fjxxxgpx06/x08/x10 ds70286a-page 78 ? 2007 microchip technology inc. 5.3 special function register reset states most of the special function registers (sfrs) associ- ated with the cpu and peripherals are reset to a particular value at a device reset. the sfrs are grouped by their peripheral or cpu function and their reset values are specified in each section of this manual. the reset value for each sfr does not depend on the type of reset, with the exception of two registers. the reset value for the reset control register, rcon, depends on the type of device reset. the reset value for the oscillator control register, osccon, depends on the type of reset and the programmed values of the oscillator configuration bits in the fosc configuration register.
? 2007 microchip technology inc. ds70286a-page 79 dspic33fjxxxgpx06/x08/x10 6.0 interrupt controller the dspic33fjxxxgpx06/x08/x10 interrupt control- ler reduces the numerous peripheral interrupt request signals to a single interrupt request signal to the dspic33fjxxxgpx06/x08/x10 cpu. it has the fol- lowing features: ? up to 8 processor exceptions and software traps ? 7 user-selectable priority levels ? interrupt vector table (ivt) with up to 118 vectors ? a unique vector for each interrupt or exception source ? fixed priority within a specified user priority level ? alternate interrupt vector table (aivt) for debug support ? fixed interrupt entry and return latencies 6.1 interrupt vector table the interrupt vector table is shown in figure 6-1. the ivt resides in program memory, starting at location 000004h. the ivt contains 126 vectors consisting of 8 nonmaskable trap vectors plus up to 118 sources of interrupt. in general, each interrupt source has its own vector. each interrupt vector contains a 24-bit wide address. the value programmed into each interrupt vector location is the starting address of the associated interrupt service routine (isr). interrupt vectors are prioritized in terms of their natural priority; this priority is linked to their position in the vector table. all other things being equal, lower addresses have a higher natural priority. for example, the interrupt associated with vector 0 will take priority over interrupts at any other vector address. dspic33fjxxxgpx06/x08/x10 devices implement up to 67 unique interrupts and 5 nonmaskable traps. these are summarized in table 6-1 and table 6-2. 6.1.1 alternate vector table the alternate interrupt vector table (aivt) is located after the ivt, as shown in figure 6-1. access to the aivt is provided by the altivt control bit (intcon2<15>). if the altivt bit is set, all interrupt and exception processes use the alternate vectors instead of the default vectors. the alternate vectors are organized in the same manner as the default vectors. the aivt supports debugging by providing a means to switch between an application and a support environment without requiring the interrupt vectors to be reprogrammed. this feature also enables switching between applications for evaluation of different software algorithms at run time. if the aivt is not needed, the aivt should be programmed with the same addresses used in the ivt. 6.2 reset sequence a device reset is not a true exception because the interrupt controller is not involved in the reset process. the dspic33fjxxxgpx06/x08/x10 device clears its registers in response to a reset, which forces the pc to zero. the digital signal controller then begins pro- gram execution at location 0x000000. the user pro- grams a goto instruction at the reset address which redirects program execution to the appropriate start-up routine. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the lat- est dspic33f family reference manual sections. note: any unimplemented or unused vector locations in the ivt and aivt should be programmed with the address of a default interrupt handler routine that contains a reset instruction.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 80 ? 2007 microchip technology inc. figure 6-1: dspic33fjxxxgpx06/x08/x10 interrupt vector table reset ? goto instruction 0x000000 reset ? goto address 0x000002 reserved 0x000004 oscillator fail trap vector address error trap vector stack error trap vector math error trap vector dma error trap vector reserved reserved interrupt vector 0 0x000014 interrupt vector 1 ~ ~ ~ interrupt vector 52 0x00007c interrupt vector 53 0x00007e interrupt vector 54 0x000080 ~ ~ ~ interrupt vector 116 0x0000fc interrupt vector 117 0x0000fe reserved 0x000100 reserved 0x000102 reserved oscillator fail trap vector address error trap vector stack error trap vector math error trap vector dma error trap vector reserved reserved interrupt vector 0 0x000114 interrupt vector 1 ~ ~ ~ interrupt vector 52 0x00017c interrupt vector 53 0x00017e interrupt vector 54 0x000180 ~ ~ ~ interrupt vector 116 interrupt vector 117 0x0001fe start of code 0x000200 decreasing natural order priority interrupt vector table (ivt) (1) alternate interrupt vector table (aivt) (1) note 1: see table 6-1 for the list of implemented interrupt vectors.
? 2007 microchip technology inc. ds70286a-page 81 dspic33fjxxxgpx06/x08/x10 table 6-1: interrupt vectors vector number interrupt request (irq) number ivt address aivt addr ess interrupt source 8 0 0x000014 0x000114 int0 ? external interrupt 0 9 1 0x000016 0x000116 ic1 ? input compare 1 10 2 0x000018 0x000118 oc1 ? output compare 1 11 3 0x00001a 0x00011a t1 ? timer1 12 4 0x00001c 0x00011c dma0 ? dma channel 0 13 5 0x00001e 0x00011e ic2 ? input capture 2 14 6 0x000020 0x000120 oc2 ? output compare 2 15 7 0x000022 0x000122 t2 ? timer2 16 8 0x000024 0x000124 t3 ? timer3 17 9 0x000026 0x000126 spi1e ? spi1 error 18 10 0x000028 0x000128 spi1 ? spi1 transfer done 19 11 0x00002a 0x00012a u1rx ? uart1 receiver 20 12 0x00002c 0x00012c u1tx ? uart1 transmitter 21 13 0x00002e 0x00012e adc1 ? adc 1 22 14 0x000030 0x000130 dma1 ? dma channel 1 23 15 0x000032 0x000132 reserved 24 16 0x000034 0x000134 si2c1 ? i2c1 slave events 25 17 0x000036 0x000136 mi2c1 ? i2c1 master events 26 18 0x000038 0x000138 reserved 27 19 0x00003a 0x00013a change notification interrupt 28 20 0x00003c 0x00013c int1 ? external interrupt 1 29 21 0x00003e 0x00013e adc2 ? adc 2 30 22 0x000040 0x000140 ic7 ? input capture 7 31 23 0x000042 0x000142 ic8 ? input capture 8 32 24 0x000044 0x000144 dma2 ? dma channel 2 33 25 0x000046 0x000146 oc3 ? output compare 3 34 26 0x000048 0x000148 oc4 ? output compare 4 35 27 0x00004a 0x00014a t4 ? timer4 36 28 0x00004c 0x00014c t5 ? timer5 37 29 0x00004e 0x00014e int2 ? external interrupt 2 38 30 0x000050 0x000150 u2rx ? uart2 receiver 39 31 0x000052 0x000152 u2tx ? uart2 transmitter 40 32 0x000054 0x000154 spi2e ? spi2 error 41 33 0x000056 0x000156 spi1 ? spi1 transfer done 42 34 0x000058 0x000158 c1rx ? ecan1 receive data ready 43 35 0x00005a 0x00015a c1 ? ecan1 event 44 36 0x00005c 0x00015c dma3 ? dma channel 3 45 37 0x00005e 0x00015e ic3 ? input capture 3 46 38 0x000060 0x000160 ic4 ? input capture 4 47 39 0x000062 0x000162 ic5 ? input capture 5 48 40 0x000064 0x000164 ic6 ? input capture 6 49 41 0x000066 0x000166 oc5 ? output compare 5 50 42 0x000068 0x000168 oc6 ? output compare 6 51 43 0x00006a 0x00016a oc7 ? output compare 7 52 44 0x00006c 0x00016c oc8 ? output compare 8 53 45 0x00006e 0x00016e reserved
dspic33fjxxxgpx06/x08/x10 ds70286a-page 82 ? 2007 microchip technology inc. table 6-2: trap vectors 54 46 0x000070 0x000170 dma4 ? dma channel 4 55 47 0x000072 0x000172 t6 ? timer6 56 48 0x000074 0x000174 t7 ? timer7 57 49 0x000076 0x000176 si2c2 ? i2c2 slave events 58 50 0x000078 0x000178 mi2c2 ? i2c2 master events 59 51 0x00007a 0x00017a t8 ? timer8 60 52 0x00007c 0x00017c t9 ? timer9 61 53 0x00007e 0x00017e int3 ? external interrupt 3 62 54 0x000080 0x000180 int4 ? external interrupt 4 63 55 0x000082 0x000182 c2rx ? ecan2 receive data ready 64 56 0x000084 0x000184 c2 ? ecan2 event 65 57 0x000086 0x000186 reserved 66 58 0x000088 0x000188 reserved 67 59 0x00008a 0x00018a dcie ? dci error 68 60 0x00008c 0x00018c dcid ? dci transfer done 69 61 0x00008e 0x00018e dma5 ? dma channel 5 70 62 0x000090 0x000190 reserved 71 63 0x000092 0x000192 reserved 72 64 0x000094 0x000194 reserved 73 65 0x000096 0x000196 u1e ? uart1 error 74 66 0x000098 0x000198 u2e ? uart2 error 75 67 0x00009a 0x00019a reserved 76 68 0x00009c 0x00019c dma6 ? dma channel 6 77 69 0x00009e 0x00019e dma7 ? dma channel 7 78 70 0x0000a0 0x0001a0 c1tx ? ecan1 transmit data request 79 71 0x0000a2 0x0001a2 c2tx ? ecan2 transmit data request 80-125 72-117 0x0000a4- 0x0000fe 0x0001a4- 0x0001fe reserved vector number ivt addres s aivt address trap source 0 0x000004 0x000104 reserved 1 0x000006 0x000106 oscillator failure 2 0x000008 0x000108 address error 3 0x00000a 0x00010a stack error 4 0x00000c 0x00010c math error 5 0x00000e 0x00010e dma error trap 6 0x000010 0x000110 reserved 7 0x000012 0x000112 reserved table 6-1: interrupt vectors (continued) vector number interrupt request (irq) number ivt address aivt addr ess interrupt source
? 2007 microchip technology inc. ds70286a-page 83 dspic33fjxxxgpx06/x08/x10 6.3 interrupt control and status registers dspic33fjxxxgpx06/x08/x10 devices implement a total of 30 registers for the interrupt controller: ? intcon1 ? intcon2 ? ifs0 through ifs4 ? iec0 through iec4 ? ipc0 through ipc17 ?inttreg global interrupt control functions are controlled from intcon1 and intcon2. intcon1 contains the inter- rupt nesting disable (nstdis) bit as well as the control and status flags for the processor trap sources. the intcon2 register controls the external interrupt request signal behavior and the use of the alternate interrupt vector table. the ifs registers maintain all of the interrupt request flags. each source of interrupt has a status bit, which is set by the respective peripherals or external signal and is cleared via software. the iec registers maintain all of the interrupt enable bits. these control bits are used to individually enable interrupts from the peripherals or external signals. the ipc registers are used to set the interrupt priority level for each source of interrupt. each user interrupt source can be assigned to one of eight priority levels. the inttreg register contains the associated interrupt vector number and the new cpu interrupt priority level, which are latched into vector number (vecnum<6:0>) and interrupt level (ilr<3:0>) bit fields in the inttreg register. the new interrupt priority level is the priority of the pending interrupt. the interrupt sources are assigned to the ifsx, iecx and ipcx registers in the same sequence that they are listed in table 6-1. for example, the int0 (external interrupt 0) is shown as having vector number 8 and a natural order priority of 0. thus, the int0if bit is found in ifs0<0>, the int0ie bit in iec0<0>, and the int0ip bits in the first position of ipc0 (ipc0<2:0>). although they are not specifically part of the interrupt control hardware, two of the cpu control registers contain bits that control interrupt functionality. the cpu status register, sr, contains the ipl<2:0> bits (sr<7:5>). these bits indicate the current cpu interrupt priority level. the user can change the current cpu priority level by writing to the ipl bits. the corcon register contains the ipl3 bit which, together with ipl<2:0>, also indicates the current cpu priority level. ipl3 is a read-only bit so that trap events cannot be masked by the user software. all interrupt registers are described in register 6-1 through register 6-32, in the following pages.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 84 ? 2007 microchip technology inc. register 6-1: sr: cpu status register (1) r-0 r-0 r/c-0 r/c-0 r-0 r/c-0 r -0 r/w-0 oa ob sa sb oab sab da dc bit 15 bit 8 r/w-0 (3) r/w-0 (3) r/w-0 (3) r-0 r/w-0 r/w-0 r/w-0 r/w-0 ipl2 (2) ipl1 (2) ipl0 (2) ra n ov z c bit 7 bit 0 legend: c = clear only bit r = readable bit u = unimplemented bit, read as ?0? s = set only bit w = writable bit -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 7-5 ipl<2:0>: cpu interrupt priority level status bits (1) 111 = cpu interrupt priority level is 7 (15), user interrupts disabled 110 = cpu interrupt priority level is 6 (14) 101 = cpu interrupt priority level is 5 (13) 100 = cpu interrupt priority level is 4 (12) 011 = cpu interrupt priority level is 3 (11) 010 = cpu interrupt priority level is 2 (10) 001 = cpu interrupt priority level is 1 (9) 000 = cpu interrupt priority level is 0 (8) note 1: for complete register details, see register 2-1: ?sr: cpu status register? . 2: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read-only when nstdis (intcon1<15>) = 1 . register 6-2: corcon: core control register (1) u-0 u-0 u-0 r/w-0 r/w-0 r-0 r-0 r-0 ? ? ? us edt dl<2:0> bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-0 r/c-0 r/w-0 r/w-0 r/w-0 sata satb satdw accsat ipl3 (2) psv rnd if bit 7 bit 0 legend: c = clear only bit r = readable bit w = writable bit -n = value at por ?1? = bit is set 0? = bit is cleared ?x = bit is unknown u = unimplemented bit, read as ?0? bit 3 ipl3: cpu interrupt priority level status bit 3 (2) 1 = cpu interrupt priority level is greater than 7 0 = cpu interrupt priority level is 7 or less note 1: for complete register details, see register 2-2: ?corcon: core control register? . 2: the ipl3 bit is concatenated with the ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level.
? 2007 microchip technology inc. ds70286a-page 85 dspic33fjxxxgpx06/x08/x10 register 6-3: intcon1: in terrupt control register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nstdis ovaerr ovberr covaerr covberr ovate ovbte covte bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 sftacerr div0err dmacerr matherr addrerr stkerr oscfail ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 nstdis: interrupt nesting disable bit 1 = interrupt nesting is disabled 0 = interrupt nesting is enabled bit 14 ovaerr: accumulator a overflow trap flag bit 1 = trap was caused by overflow of accumulator a 0 = trap was not caused by overflow of accumulator a bit 13 ovberr: accumulator b overflow trap flag bit 1 = trap was caused by overflow of accumulator b 0 = trap was not caused by overflow of accumulator b bit 12 covaerr: accumulator a catastrophic overflow trap enable bit 1 = trap was caused by catastrophic overflow of accumulator a 0 = trap was not caused by catastrophic overflow of accumulator a bit 11 covberr: accumulator b catastrophic overflow trap enable bit 1 = trap was caused by catastrophic overflow of accumulator b 0 = trap was not caused by catastrophic overflow of accumulator b bit 10 ovate: accumulator a overflow trap enable bit 1 = trap overflow of accumulator a 0 = trap disabled bit 9 ovbte: accumulator b overflow trap enable bit 1 = trap overflow of accumulator b 0 = trap disabled bit 8 covte: catastrophic overflow trap enable bit 1 = trap on catastrophic overflow of accumulator a or b enabled 0 = trap disabled bit 7 sftacerr: shift accumulator error status bit 1 = math error trap was caused by an invalid accumulator shift 0 = math error trap was not caused by an invalid accumulator shift bit 6 div0err: arithmetic error status bit 1 = math error trap was caused by a divide by zero 0 = math error trap was not caused by a divide by zero bit 5 dmacerr: dma controller error status bit 1 = dma controller error trap has occurred 0 = dma controller error trap has not occurred bit 4 matherr: arithmetic error status bit 1 = math error trap has occurred 0 = math error trap has not occurred
dspic33fjxxxgpx06/x08/x10 ds70286a-page 86 ? 2007 microchip technology inc. bit 3 addrerr: address error trap status bit 1 = address error trap has occurred 0 = address error trap has not occurred bit 2 stkerr: stack error trap status bit 1 = stack error trap has occurred 0 = stack error trap has not occurred bit 1 oscfail: oscillator failure trap status bit 1 = oscillator failure trap has occurred 0 = oscillator failure trap has not occurred bit 0 unimplemented: read as ? 0 ? register 6-3: intcon1: interrupt control register 1 (continued)
? 2007 microchip technology inc. ds70286a-page 87 dspic33fjxxxgpx06/x08/x10 register 6-4: intcon2: in terrupt control register 2 r/w-0 r-0 u-0 u-0 u-0 u-0 u-0 u-0 altivt disi ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? int4ep int3ep int2ep int1ep int0ep bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 altivt: enable alternate interrupt vector table bit 1 = use alternate vector table 0 = use standard (default) vector table bit 14 disi: disi instruction status bit 1 = disi instruction is active 0 = disi instruction is not active bit 13-5 unimplemented: read as ? 0 ? bit 4 int4ep: external interrupt 4 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 3 int3ep: external interrupt 3 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 2 int2ep: external interrupt 2 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 1 int1ep: external interrupt 1 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 0 int0ep: external interrupt 0 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge
dspic33fjxxxgpx06/x08/x10 ds70286a-page 88 ? 2007 microchip technology inc. register 6-5: ifs0: interrupt flag status register 0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 t2if oc2if ic2if dma01if t1if oc1if ic1if int0if bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14 dma1if: dma channel 1 data transfer complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 13 ad1if: adc1 conversion complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 12 u1txif: uart1 transmitter interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 11 u1rxif: uart1 receiver interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 10 spi1if: spi1 event interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 9 spi1eif: spi1 fault interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 8 t3if: timer3 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 7 t2if: timer2 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 6 oc2if: output compare channel 2 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 5 ic2if: input capture channel 2 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 4 dma0if: dma channel 0 data transfer complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 3 t1if: timer1 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred
? 2007 microchip technology inc. ds70286a-page 89 dspic33fjxxxgpx06/x08/x10 bit 2 oc1if: output compare channel 1 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 1 ic1if: input capture channel 1 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 0 int0if: external interrupt 0 flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred register 6-5: ifs0: interrupt fla g status register 0 (continued)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 90 ? 2007 microchip technology inc. register 6-6: ifs1: interrupt flag status register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u2txif u2rxif int2if t5if t4if oc4if oc3if dma21if bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ic8if ic7if ad2if int1if cnif ? mi2c1if si2c1if bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 u2txif: uart2 transmitter interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 14 u2rxif: uart2 receiver interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 13 int2if: external interrupt 2 flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 12 t5if: timer5 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 11 t4if: timer4 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 10 oc4if: output compare channel 4 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 9 oc3if: output compare channel 3 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 8 dma2if: dma channel 2 data transfer complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 7 ic8if: input capture channel 8 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 6 ic7if: input capture channel 7 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 5 ad2if: adc2 conversion complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 4 int1if: external interrupt 1 flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred
? 2007 microchip technology inc. ds70286a-page 91 dspic33fjxxxgpx06/x08/x10 bit 3 cnif: input change notification interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 2 unimplemented: read as ? 0 ? bit 1 mi2c1if: i2c1 master events interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 0 si2c1if: i2c1 slave events interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred register 6-6: ifs1: interrupt fla g status register 1 (continued)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 92 ? 2007 microchip technology inc. register 6-7: ifs2: interrupt flag status register 2 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 t6if dma4if ? oc8if oc7if oc6if oc5if ic6if bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ic5if ic4if ic3if dma3if c1if c1rxif spi2if spi2eif bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 t6if: timer6 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 14 dma4if: dma channel 4 data transfer complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 13 unimplemented: read as ? 0 ? bit 12 oc8if: output compare channel 8 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 11 oc7if: output compare channel 7 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 10 oc6if: output compare channel 6 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 9 oc5if: output compare channel 5 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 8 ic6if: input capture channel 6 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 7 ic5if: input capture channel 5 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 6 ic4if: input capture channel 4 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 5 ic3if: input capture channel 3 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 4 dma3if: dma channel 3 data transfer complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 3 c1if: ecan1 event interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred
? 2007 microchip technology inc. ds70286a-page 93 dspic33fjxxxgpx06/x08/x10 bit 2 c1rxif: ecan1 receive data ready interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 1 spi2if: spi2 event interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 0 spi2eif: spi2 error interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred register 6-7: ifs2: interrupt fla g status register 2 (continued)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 94 ? 2007 microchip technology inc. register 6-8: ifs3: interrupt flag status register 3 u-0 u-0 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 ? ? dma5if dciif dcieif ? ?c2if bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 c2rxif int4if int3if t9if t8if mi2c2if si2c2if t7if bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 dma5if: dma channel 5 data transfer complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 12 dciif: dci event interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 11 dcieif: dci error interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 10-9 unimplemented: read as ? 0 ? bit 8 c2if: ecan2 event interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 7 c2rxif: ecan2 receive data ready interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 6 int4if: external interrupt 4 flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 5 int3if: external interrupt 3 flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 4 t9if: timer9 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 3 t8if: timer8 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 2 mi2c2if: i2c2 master events interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 1 si2c2if: i2c2 slave events interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 0 t7if: timer7 interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred
? 2007 microchip technology inc. ds70286a-page 95 dspic33fjxxxgpx06/x08/x10 register 6-9: ifs4: interrupt flag status register 4 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 u-0 c2txif c1txif dma7if dma6if ?u2eifu1eif ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7 c2txif: ecan2 transmit data request interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 6 c1txif: ecan1 transmit data request interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 5 dma7if: dma channel 7 data transfer complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 4 dma6if: dma channel 6 data transfer complete interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 3 unimplemented: read as ? 0 ? bit 2 u2eif: uart2 error interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 1 u1eif: uart1 error interrupt flag status bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 0 unimplemented: read as ? 0 ?
dspic33fjxxxgpx06/x08/x10 ds70286a-page 96 ? 2007 microchip technology inc. register 6-10: iec0: interrupt enable control register 0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14 dma1ie: dma channel 1 data transfer complete interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 13 ad1ie: adc1 conversion complete interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 12 u1txie: uart1 transmitter interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 11 u1rxie: uart1 receiver interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 10 spi1ie: spi1 event interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 9 spi1eie: spi1 error interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 8 t3ie: timer3 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 7 t2ie: timer2 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 6 oc2ie: output compare channel 2 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 5 ic2ie: input capture channel 2 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 4 dma0ie: dma channel 0 data transfer complete interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 3 t1ie: timer1 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled
? 2007 microchip technology inc. ds70286a-page 97 dspic33fjxxxgpx06/x08/x10 bit 2 oc1ie: output compare channel 1 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 1 ic1ie: input capture channel 1 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 0 int0ie: external interrupt 0 enable bit 1 = interrupt request enabled 0 = interrupt request not enabled register 6-10: iec0: interrupt enable control register 0 (continued)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 98 ? 2007 microchip technology inc. register 6-11: iec1: interrupt enable control register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ic8ie ic7ie ad2ie int1ie cnie ? mi2c1ie si2c1ie bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 u2txie: uart2 transmitter interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 14 u2rxie: uart2 receiver interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 13 int2ie: external interrupt 2 enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 12 t5ie: timer5 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 11 t4ie: timer4 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 10 oc4ie: output compare channel 4 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 9 oc3ie: output compare channel 3 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 8 dma2ie: dma channel 2 data transfer complete interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 7 ic8ie: input capture channel 8 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 6 ic7ie: input capture channel 7 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 5 ad2ie: adc2 conversion complete interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 4 int1ie: external interrupt 1 enable bit 1 = interrupt request enabled 0 = interrupt request not enabled
? 2007 microchip technology inc. ds70286a-page 99 dspic33fjxxxgpx06/x08/x10 bit 3 cnie: input change notification interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 2 unimplemented: read as ? 0 ? bit 1 mi2c1ie: i2c1 master events interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 0 si2c1ie: i2c1 slave events interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled register 6-11: iec1: interrupt enable control register 1 (continued)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 100 ? 2007 microchip technology inc. register 6-12: iec2: interrupt enable control register 2 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 t6ie dma4ie ? oc8ie oc7ie oc6ie oc5ie ic6ie bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ic5ie ic4ie ic3ie dma3ie c1ie c1rxie spi2ie spi2eie bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 t6ie: timer6 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 14 dma4ie: dma channel 4 data transfer complete interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 13 unimplemented: read as ? 0 ? bit 12 oc8ie: output compare channel 8 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 11 oc7ie: output compare channel 7 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 10 oc6ie: output compare channel 6 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 9 oc5ie: output compare channel 5 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 8 ic6ie: input capture channel 6 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 7 ic5ie: input capture channel 5 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 6 ic4ie: input capture channel 4 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 5 ic3ie: input capture channel 3 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 4 dma3ie: dma channel 3 data transfer complete interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 3 c1ie: ecan1 event interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled
? 2007 microchip technology inc. ds70286a-page 101 dspic33fjxxxgpx06/x08/x10 bit 2 c1rxie: ecan1 receive data ready interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 1 spi2ie: spi2 event interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 0 spi2eie: spi2 error interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled register 6-12: iec2: interrupt enable control register 2 (continued)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 102 ? 2007 microchip technology inc. register 6-13: iec3: interrupt enable control register 3 u-0 u-0 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 ? ? dma5ie dciie dcieie ? ?c2ie bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 c2rxie int4ie int3ie t9ie t8ie mi2c2ie si2c2ie t7ie bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 dma5ie: dma channel 5 data transfer complete interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 12 dciie: dci event interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 11 dcieie: dci error interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 10-9 unimplemented: read as ? 0 ? bit 8 c2ie: ecan2 event interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 7 c2rxie: ecan2 receive data ready interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 6 int4ie: external interrupt 4 enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 5 int3ie: external interrupt 3 enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 4 t9ie: timer9 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 3 t8ie: timer8 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 2 mi2c2ie: i2c2 master events interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 1 si2c2ie: i2c2 slave events interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 0 t7ie: timer7 interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled
? 2007 microchip technology inc. ds70286a-page 103 dspic33fjxxxgpx06/x08/x10 register 6-14: iec4: interrupt enable control register 4 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 u-0 c2txie c1txie dma7ie dma6ie ?u2eieu1eie ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7 c2txie: ecan2 transmit data request interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 6 c1txie: ecan1 transmit data request interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 5 dma7ie: dma channel 7 data transfer complete enable status bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 4 dma6ie: dma channel 6 data transfer complete enable status bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 3 unimplemented: read as ? 0 ? bit 2 u2eie: uart2 error interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 1 u1eie: uart1 error interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 0 unimplemented: read as ? 0 ?
dspic33fjxxxgpx06/x08/x10 ds70286a-page 104 ? 2007 microchip technology inc. register 6-15: ipc0: interrupt pr iority control register 0 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? t1ip<2:0> ? oc1ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? ic1ip<2:0> ? int0ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 t1ip<2:0>: timer1 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 oc1ip<2:0>: output compare channel 1 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 ic1ip<2:0>: input capture channel 1 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 int0ip<2:0>: external interrupt 0 priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
? 2007 microchip technology inc. ds70286a-page 105 dspic33fjxxxgpx06/x08/x10 register 6-16: ipc1: interrupt pr iority control register 1 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? t2ip<2:0> ? oc2ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? ic2ip<2:0> ? dma0ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 t2ip<2:0>: timer2 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 oc2ip<2:0>: output compare channel 2 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 ic2ip<2:0>: input capture channel 2 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 dma0ip<2:0>: dma channel 0 data transfer complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 106 ? 2007 microchip technology inc. register 6-17: ipc2: interrupt pr iority control register 2 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? u1rxip<2:0> ? spi1ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? spi1eip<2:0> ? t3ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 u1rxip<2:0>: uart1 receiver interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 spi1ip<2:0>: spi1 event interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 spi1eip<2:0>: spi1 error interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 t3ip<2:0>: timer3 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
? 2007 microchip technology inc. ds70286a-page 107 dspic33fjxxxgpx06/x08/x10 register 6-18: ipc3: interrupt pr iority control register 3 u-0 u-0 u-0 u-0 u-0 r/w-1 r/w-0 r/w-0 ? ? ? ? ? dma1ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? ad1ip<2:0> ? u1txip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10-8 dma1ip<2:0>: dma channel 1 data transfer complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 ad1ip<2:0>: adc1 conversion complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 u1txip<2:0>: uart1 transmitter interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 108 ? 2007 microchip technology inc. register 6-19: ipc4: interrupt pr iority control register 4 u-0 r/w-1 r/w-0 r/w-0 u-0 u-0 u-0 u-0 ?cnip<2:0> ? ? ? ? bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? mi2c1ip<2:0> ? si2c1ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 cnip<2:0>: change notification interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11-7 unimplemented: read as ? 0 ? bit 6-4 mi2c1ip<2:0>: i2c1 master events interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 si2c1ip<2:0>: i2c1 slave events interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
? 2007 microchip technology inc. ds70286a-page 109 dspic33fjxxxgpx06/x08/x10 register 6-20: ipc5: interrupt pr iority control register 5 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? ic8ip<2:0> ?ic7ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? ad2ip<2:0> ? int1ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 ic8ip<2:0>: input capture channel 8 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 ic7ip<2:0>: input capture channel 7 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 ad2ip<2:0>: adc2 conversion complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 int1ip<2:0>: external interrupt 1 priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 110 ? 2007 microchip technology inc. register 6-21: ipc6: interrupt pr iority control register 6 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? t4ip<2:0> ? oc4ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ?oc3ip<2:0> ? dma2ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 t4ip<2:0>: timer4 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 oc4ip<2:0>: output compare channel 4 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 oc3ip<2:0>: output compare channel 3 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 dma2ip<2:0>: dma channel 2 data transfer complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
? 2007 microchip technology inc. ds70286a-page 111 dspic33fjxxxgpx06/x08/x10 register 6-22: ipc7: interrupt pr iority control register 7 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? u2txip<2:0> ? u2rxip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? int2ip<2:0> ? t5ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 u2txip<2:0>: uart2 transmitter interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 u2rxip<2:0>: uart2 receiver interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 int2ip<2:0>: external interrupt 2 priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 t5ip<2:0>: timer5 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 112 ? 2007 microchip technology inc. register 6-23: ipc8: interrupt pr iority control register 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? c1ip<2:0> ? c1rxip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? spi2ip<2:0> ? spi2eip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 c1ip<2:0>: ecan1 event interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 c1rxip<2:0>: ecan1 receive data ready interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 spi2ip<2:0>: spi2 event interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 spi2eip<2:0>: spi2 error interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
? 2007 microchip technology inc. ds70286a-page 113 dspic33fjxxxgpx06/x08/x10 register 6-24: ipc9: interrupt pr iority control register 9 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? ic5ip<2:0> ?ic4ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? ic3ip<2:0> ? dma3ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 ic5ip<2:0>: input capture channel 5 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 ic4ip<2:0>: input capture channel 4 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 ic3ip<2:0>: input capture channel 3 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 dma3ip<2:0>: dma channel 3 data transfer complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 114 ? 2007 microchip technology inc. register 6-25: ipc10: interrupt priority control register 10 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ?oc7ip<2:0> ? oc6ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ?oc5ip<2:0> ? ic6ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 oc7ip<2:0>: output compare channel 7 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 oc6ip<2:0>: output compare channel 6 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 oc5ip<2:0>: output compare channel 5 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 ic6ip<2:0>: input capture channel 6 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
? 2007 microchip technology inc. ds70286a-page 115 dspic33fjxxxgpx06/x08/x10 register 6-26: ipc11: interrupt priority control register 11 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? t6ip<2:0> ? dma4ip<2:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-1 r/w-0 r/w-0 ? ? ? ? ? oc8ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 t6ip<2:0>: timer6 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 dma4ip<2:0>: dma channel 4 data transfer complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7-3 unimplemented: read as ? 0 ? bit 2-0 oc8ip<2:0>: output compare channel 8 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 116 ? 2007 microchip technology inc. register 6-27: ipc12: interrupt priority control register 12 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? t8ip<2:0> ? mi2c2ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? si2c2ip<2:0> ? t7ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 t8ip<2:0>: timer8 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 mi2c2ip<2:0>: i2c2 master events interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 si2c2ip<2:0>: i2c2 slave events interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 t7ip<2:0>: timer7 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
? 2007 microchip technology inc. ds70286a-page 117 dspic33fjxxxgpx06/x08/x10 register 6-28: ipc13: interrupt priority control register 13 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? c2rxip<2:0> ? int4ip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? int3ip<2:0> ? t9ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 c2rxip<2:0>: ecan2 receive data ready interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 int4ip<2:0>: external interrupt 4 priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 int3ip<2:0>: external interrupt 3 priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 t9ip<2:0>: timer9 interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 118 ? 2007 microchip technology inc. register 6-29: ipc14: interrupt priority control register 14 u-0 r/w-1 r/w-0 r/w-0 u-0 u-0 u-0 u-0 ? dcieip<2:0> ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-1 r/w-0 r/w-0 ? ? ? ? ? c2ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 dcieip<2:0>: dci error interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11-8 unimplemented: read as ? 0 ? bit 7-3 unimplemented: read as ? 0 ? bit 2-0 c2ip<2:0>: ecan2 event interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
? 2007 microchip technology inc. ds70286a-page 119 dspic33fjxxxgpx06/x08/x10 register 6-30: ipc15: interrupt priority control register 15 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? dma5ip<2:0> ? dciip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7 unimplemented: read as ? 0 ? bit 6-4 dma5ip<2:0>: dma channel 5 data transfer complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 dciip<2:0>: dci event interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 120 ? 2007 microchip technology inc. register 6-31: ipc16: interrupt priority control register 16 u-0 u-0 u-0 u-0 u-0 r/w-1 r/w-0 r/w-0 ? ? ? ? ? u2eip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 u-0 u-0 u-0 ? u1eip<2:0> ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10-8 u2eip<2:0>: uart2 error interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 u1eip<2:0>: uart1 error interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3-0 unimplemented: read as ? 0 ?
? 2007 microchip technology inc. ds70286a-page 121 dspic33fjxxxgpx06/x08/x10 register 6-32: ipc17: interrupt priority control register 17 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? c2txip<2:0> ? c1txip<2:0> bit 15 bit 8 u-0 r/w-1 r/w-0 r/w-0 u-0 r/w-1 r/w-0 r/w-0 ? dma7ip<2:0> ? dma6ip<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 c2txip<2:0>: ecan2 transmit data request interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 11 unimplemented: read as ? 0 ? bit 10-8 c1txip<2:0>: ecan1 transmit data request interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 7 unimplemented: read as ? 0 ? bit 6-4 dma7ip<2:0>: dma channel 7 data transfer complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled bit 3 unimplemented: read as ? 0 ? bit 2-0 dma6ip<2:0>: dma channel 6 data transfer complete interrupt priority bits 111 = interrupt is priority 7 (highest priority interrupt) ? ? ? 001 = interrupt is priority 1 000 = interrupt source is disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 122 ? 2007 microchip technology inc. register 6-33: inttreg: interrupt control and status register r-0 r/w-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ?ilr<3:0> bit 15 bit 8 u-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 ? vecnum<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-8 ilr: new cpu interrupt priority level bits 1111 = cpu interrupt priority level is 15 ? ? ? 0001 = cpu interrupt priority level is 1 0000 = cpu interrupt priority level is 0 bit 7 unimplemented: read as ? 0 ? bit 6-0 vecnum: vector number of pending interrupt bits 0111111 = interrupt vector pending is number 135 ? ? ? 0000001 = interrupt vector pending is number 9 0000000 = interrupt vector pending is number 8
? 2007 microchip technology inc. ds70286a-page 123 dspic33fjxxxgpx06/x08/x10 6.4 interrupt setup procedures 6.4.1 initialization to configure an interrupt source: 1. set the nstdis bit (intcon1<15>) if nested interrupts are not desired. 2. select the user-assigned priority level for the interrupt source by writing the control bits in the appropriate ipcx register. the priority level will depend on the specific application and type of interrupt source. if multiple priority levels are not desired, the ipcx register control bits for all enabled interrupt sources may be programmed to the same non-zero value. 3. clear the interrupt flag status bit associated with the peripheral in the associated ifsx register. 4. enable the interrupt source by setting the inter- rupt enable control bit associated with the source in the appropriate iecx register. 6.4.2 interrupt service routine the method that is used to declare an isr and initialize the ivt with the correct vector address will depend on the programming language (i.e., c or assembler) and the language development toolsuite that is used to develop the application. in general, the user must clear the interrupt flag in the appropriate ifsx register for the source of interrupt that the isr handles. otherwise, the isr will be re-entered immediately after exiting the routine. if the isr is coded in assembly language, it must be terminated using a retfie instruction to unstack the saved pc value, srl value and old cpu priority level. 6.4.3 trap service routine a trap service routine (tsr) is coded like an isr, except that the appropriate trap status flag in the intcon1 register must be cleared to avoid re-entry into the tsr. 6.4.4 interrupt disable all user interrupts can be disabled using the following procedure: 1. push the current sr value onto the software stack using the push instruction. 2. force the cpu to priority level 7 by inclusive oring the value oeh with srl. to enable user interrupts, the pop instruction may be used to restore the previous sr value. note that only user interrupts with a priority level of 7 or less can be disabled. trap sources (level 8-level 15) cannot be disabled. the disi instruction provides a convenient way to dis- able interrupts of priority levels 1-6 for a fixed period of time. level 7 interrupt sources are not disabled by the disi instruction. note: at a device reset, the ipcx registers are initialized, such that all user interrupt sources are assigned to priority level 4.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 124 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 125 dspic33fjxxxgpx06/x08/x10 7.0 direct memory access (dma) direct memory access (dma) is a very efficient mechanism of copying data between peripheral sfrs (e.g., uart receive register, input capture 1 buffer), and buffers or variables stored in ram, with minimal cpu intervention. the dma controller can automatically copy entire blocks of data without requiring the user software to read or write the peripheral special function registers (sfrs) every time a peripheral interrupt occurs. the dma controller uses a dedicated bus for data transfers and therefore, does not steal cycles from the code execution flow of the cpu. to exploit the dma capability, the corresponding user buffers or variables must be located in dma ram. the dspic33fjxxxgpx06/x08/x10 peripherals that can utilize dma are listed in table 7-1 along with their associated interrupt request (irq) numbers. table 7-1: peripherals with dma support the dma controller features eight identical data transfer channels. each channel has its own set of control and status registers. each dma channel can be configured to copy data either from buffers stored in dual port dma ram to peripheral sfrs, or from peripheral sfrs to buffers in dma ram. the dma controller supports the following features: ? word or byte sized data transfers. ? transfers from peripheral to dma ram or dma ram to peripheral. ? indirect addressing of dma ram locations with or without automatic post-increment. ? peripheral indirect addressing ? in some peripherals, the dma ram read/write addresses may be partially derived from the peripheral. ? one-shot block transfers ? terminating dma transfer after one block transfer. ? continuous block transfers ? reloading dma ram buffer start address after every block transfer is complete. ? ping-pong mode ? switching between two dma ram start addresses between successive block transfers, thereby filling two buffers alternately. ? automatic or manual initiation of block transfers ? each channel can select from 20 possible sources of data sources or destinations. for each dma channel, a dma interrupt request is generated when a block transfer is complete. alternatively, an interrupt can be generated when half of the block has been filled. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. peripheral irq number int0 0 input capture 1 1 input capture 2 5 output compare 1 2 output compare 2 6 timer2 7 timer3 8 spi1 10 spi2 33 uart1 reception 11 uart1 transmission 12 uart2 reception 30 uart2 transmission 31 adc1 13 adc2 21 dci 60 ecan1 reception 34 ecan1 transmission 70 ecan2 reception 55 ecan2 transmission 71 peripheral irq number
dspic33fjxxxgpx06/x08/x10 ds70286a-page 126 ? 2007 microchip technology inc. figure 7-1: top level system architecture using a dedicated transaction bus 7.1 dmac registers each dmac channel x (x = 0, 1, 2, 3, 4, 5, 6 or 7) contains the following registers: ? a 16-bit dma channel control register (dmaxcon) ? a 16-bit dma channel irq select register (dmaxreq) ? a 16-bit dma ram primary start address offset register (dmaxsta) ? a 16-bit dma ram secondary start address offset register (dmaxstb) ? a 16-bit dma peripheral address register (dmaxpad) ? a 10-bit dma transfer count register (dmaxcnt) an additional pair of status registers, dmacs0 and dmacs1, are common to all dmac channels. cpu sram dma ram cpu peripheral ds bus peripheral 3 dma peripheral non-dma sram x-bus port 2 port 1 peripheral 1 dma ready peripheral 2 dma ready ready ready dma ds bus cpu dma cpu dma cpu dma peripheral indirect address note: cpu and dma address buses are not shown for clarity. dma control dma controller dma channels
? 2007 microchip technology inc. ds70286a-page 127 dspic33fjxxxgpx06/x08/x10 register 7-1: dmaxcon: dm a channel x control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 chen size dir half nullw ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 ? ?amode<1:0> ? ?mode<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 chen: channel enable bit 1 = channel enabled 0 = channel disabled bit 14 size: data transfer size bit 1 = byte 0 = word bit 13 dir : transfer direction bit (source/destination bus select) 1 = read from dma ram address, write to peripheral address 0 = read from peripheral address, write to dma ram address bit 12 half: early block transfer complete interrupt select bit 1 = initiate block transfer complete interrupt when half of the data has been moved 0 = initiate block transfer complete interrupt when all of the data has been moved bit 11 nullw: null data peripheral write mode select bit 1 = null data write to peripheral in addition to dma ram write (dir bit must also be clear) 0 = normal operation bit 10-6 unimplemented: read as ? 0 ? bit 5-4 amode<1:0>: dma channel operating mode select bits 11 = reserved 10 = peripheral indirect addressing mode 01 = register indirect without post-increment mode 00 = register indirect with post-increment mode bit 3-2 unimplemented: read as ? 0 ? bit 1-0 mode<1:0>: dma channel operating mode select bits 11 = one-shot, ping-pong modes enabled (one block transfer from/to each dma ram buffer) 10 = continuous, ping-pong modes enabled 01 = one-shot, ping-pong modes disabled 00 = continuous, ping-pong modes disabled
dspic33fjxxxgpx06/x08/x10 ds70286a-page 128 ? 2007 microchip technology inc. register 7-2: dmaxreq: dma channel x irq select register r/w-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 force (1) ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 ? irqsel6 (2) irqsel5 (2) irqsel4 (2) irqsel3 (2) irqsel2 (2) irqsel1 (2) irqsel0 (2) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 force: force dma transfer bit (1) 1 = force a single dma transfer (manual mode) 0 = automatic dma transfer initiation by dma request bit 14-7 unimplemented: read as ? 0 ? bit 6-0 irqsel<6:0>: dma peripheral irq number select bits (2) 0000000 - 1111111 = dmairq0-dmairq127 selected to be channel dmareq note 1: the force bit cannot be cleared by the user. the force bit is cleared by hardware when the forced dma transfer is complete. 2: please see table 6-1 for a complete listing of irq numbers for all interrupt sources.
? 2007 microchip technology inc. ds70286a-page 129 dspic33fjxxxgpx06/x08/x10 register 7-3: dmaxsta: dma channel x ram start address offset register a r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sta<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sta<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 sta<15:0>: primary dma ram start address bits (source or destination) register 7-4: dmaxstb: dma channel x ram start address offset register b r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 stb<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 stb<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 stb<15:0>: secondary dma ram start address bits (source or destination)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 130 ? 2007 microchip technology inc. register 7-5: dmaxpad: dma channel x peripheral address register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pad<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pad<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 pad<15:0>: peripheral address register bits note 1: if the channel is enabled (i.e., active), writes to this register may result in unpredictable behavior of the dma channel and should be avoided. register 7-6: dmaxcnt: dma channel x transfer count register (1) u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 ? ? ? ? ? ? cnt<9:8> (2) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 cnt<7:0> (2) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 unimplemented: read as ? 0 ? bit 9-0 cnt<9:0>: dma transfer count register bits (2) note 1: if the channel is enabled (i.e., active), writes to this register may result in unpredictable behavior of the dma channel and should be avoided. 2: number of dma transfers = cnt<9:0> + 1.
? 2007 microchip technology inc. ds70286a-page 131 dspic33fjxxxgpx06/x08/x10 register 7-7: dmacs0: dma controller status register 0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 pwcol7 pwcol6 pwcol5 pwcol4 pwcol3 pwcol2 pwcol1 pwcol0 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 xwcol7 xwcol6 xwcol5 xwcol4 xwcol3 xwcol2 xwcol1 xwcol0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 pwcol7: channel 7 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 14 pwcol6: channel 6 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 13 pwcol5: channel 5 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 12 pwcol4: channel 4 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 11 pwcol3: channel 3 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 10 pwcol2: channel 2 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 9 pwcol1: channel 1 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 8 pwcol0: channel 0 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 7 xwcol7: channel 7 dma ram write collision flag bit 1 = write collision detected 0 = no write collision detected bit 6 xwcol6: channel 6 dma ram write collision flag bit 1 = write collision detected 0 = no write collision detected bit 5 xwcol5: channel 5 dma ram write collision flag bit 1 = write collision detected 0 = no write collision detected bit 4 xwcol4: channel 4 dma ram write collision flag bit 1 = write collision detected 0 = no write collision detected
dspic33fjxxxgpx06/x08/x10 ds70286a-page 132 ? 2007 microchip technology inc. bit 3 xwcol3: channel 3 dma ram write collision flag bit 1 = write collision detected 0 = no write collision detected bit 2 xwcol2: channel 2 dma ram write collision flag bit 1 = write collision detected 0 = no write collision detected bit 1 xwcol1: channel 1 dma ram write collision flag bit 1 = write collision detected 0 = no write collision detected bit 0 xwcol0: channel 0 dma ram write collision flag bit 1 = write collision detected 0 = no write collision detected register 7-7: dmacs0: dma controlle r status register 0 (continued)
? 2007 microchip technology inc. ds70286a-page 133 dspic33fjxxxgpx06/x08/x10 register 7-8: dmacs1: dma controller status register 1 u-0 u-0 u-0 u-0 r-1 r-1 r-1 r-1 ? ? ? ? lstch<3:0> bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 ppst7 ppst6 ppst5 ppst4 ppst3 ppst2 ppst1 ppst0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-8 lstch<3:0>: last dma channel active bits 1111 = no dma transfer has occurred since system reset 1110 - 1000 = reserved 0111 = last data transfer was by dma channel 7 0110 = last data transfer was by dma channel 6 0101 = last data transfer was by dma channel 5 0100 = last data transfer was by dma channel 4 0011 = last data transfer was by dma channel 3 0010 = last data transfer was by dma channel 2 0001 = last data transfer was by dma channel 1 0000 = last data transfer was by dma channel 0 bit 7 ppst7: channel 7 ping-pong mode status flag bit 1 = dma7stb register selected 0 = dma7sta register selected bit 6 ppst6: channel 6 ping-pong mode status flag bit 1 = dma6stb register selected 0 = dma6sta register selected bit 5 ppst5: channel 5 ping-pong mode status flag bit 1 = dma5stb register selected 0 = dma5sta register selected bit 4 ppst4: channel 4 ping-pong mode status flag bit 1 = dma4stb register selected 0 = dma4sta register selected bit 3 ppst3: channel 3 ping-pong mode status flag bit 1 = dma3stb register selected 0 = dma3sta register selected bit 2 ppst2: channel 2 ping-pong mode status flag bit 1 = dma2stb register selected 0 = dma2sta register selected bit 1 ppst1: channel 1 ping-pong mode status flag bit 1 = dma1stb register selected 0 = dma1sta register selected bit 0 ppst0: channel 0 ping-pong mode status flag bit 1 = dma0stb register selected 0 = dma0sta register selected
dspic33fjxxxgpx06/x08/x10 ds70286a-page 134 ? 2007 microchip technology inc. register 7-9: dsadr : most recent dma ram address r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 dsadr<15:8> bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 dsadr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 dsadr<15:0>: most recent dma ram address accessed by dma controller bits
? 2007 microchip technology inc. ds70286a-page 135 dspic33fjxxxgpx06/x08/x10 8.0 oscillator configuration the dspic33fjxxxgpx06/x08/x10 oscillator system provides: ? various external and internal oscillator options as clock sources ? an on-chip pll to scale the internal operating frequency to the required system clock frequency ? the internal frc oscillator can also be used with the pll, thereby allowing full-speed operation without any external clock generation hardware ? clock switching between various clock sources ? programmable clock postscaler for system power savings ? a fail-safe clock monitor (fscm) that detects clock failure and takes fail-safe measures ? a clock control register (osccon) ? nonvolatile configuration bits for main oscillator selection. a simplified diagram of the oscillator system is shown in figure 8-1. figure 8-1: dspic33fjxxxgpx06/x 08/x10 oscillator system diagram note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the lat- est dspic33f family reference manual sections. dspic33f secondary oscillator lposcen sosco sosci timer 1 osc1 osc2 primary oscillator xtpll, hspll, xt, hs, ec frcdiv<2:0> wdt, pwrt, fscm frcdivn sosc frcdiv16 ecpll, frcpll nosc<2:0> fnosc<2:0> reset frc oscillator lprc oscillator doze<2:0> s3 s1 s2 s1/s3 s7 s6 frc lprc s0 s5 s4 16 clock switch s7 clock fail 2 tun<5:0> pll (1) f cy f osc frcdiv doze note 1: see figure 8-2 for pll details
dspic33fjxxxgpx06/x08/x10 ds70286a-page 136 ? 2007 microchip technology inc. 8.1 cpu clocking system there are seven system clock options provided by the dspic33fjxxxgpx06/x08/x10: ? frc oscillator ? frc oscillator with pll ? primary (xt, hs or ec) oscillator ? primary oscillator with pll ? secondary (lp) oscillator ? lprc oscillator ? frc oscillator with postscaler 8.1.1 system clock sources the frc (fast rc) internal oscillator runs at a nominal frequency of 7.37 mhz. the user software can tune the frc frequency. user software can optionally specify a factor (ranging from 1:2 to 1:256) by which the frc clock frequency is divided. this factor is selected using the frcdiv<2:0> (clkdiv<10:8>) bits. the primary oscillator can use one of the following as its clock source: 1. xt (crystal): crystals and ceramic resonators in the range of 3 mhz to 10 mhz. the crystal is connected to the osc1 and osc2 pins. 2. hs (high-speed crystal): crystals in the range of 10 mhz to 40 mhz. the crystal is connected to the osc1 and osc2 pins. 3. ec (external clock): external clock signal in the range of 0.8 mhz to 64 mhz. the external clock signal is directly applied to the osc1 pin. the secondary (lp) oscillator is designed for low power and uses a 32.768 khz crystal or ceramic resonator. the lp oscillator uses the sosci and sosco pins. the lprc (low-power rc) internal oscillator runs at a nominal frequency of 32.768 khz. it is also used as a reference clock by the watchdog timer (wdt) and fail-safe clock monitor (fscm). the clock signals generated by the frc and primary oscillators can be optionally applied to an on-chip phase locked loop (pll) to provide a wide range of output frequencies for device operation. pll configuration is described in section 8.1.3 ?pll configuration? . 8.1.2 system clock selection the oscillator source that is used at a device power-on reset event is selected using configuration bit settings. the oscillator configuration bit settings are located in the configuration registers in the program memory. (refer to section 21.1 ?configuration bits? for further details.) the initial oscillator selection configuration bits, fnosc<2:0> (foscsel<2:0>), and the primary oscil- lator mode select configuration bits, poscmd<1:0> (fosc<1:0>), select the oscillator source that is used at a power-on reset. the frc primary oscillator is the default (unprogrammed) selection. the configuration bits allow users to choose between twelve different clock modes, shown in table 8-1. the output of the oscillator (or the output of the pll if a pll mode has been selected) f osc is divided by 2 to generate the device instruction clock (f cy ). f cy defines the operating speed of the device, and speeds up to 40 mhz are supported by the dspic33fjxxxgpx06/x08/x10 architecture. instruction execution speed or device operating frequency, f cy , is given by: equation 8-1: device operating frequency 8.1.3 pll configuration the primary oscillator and internal frc oscillator can optionally use an on-chip pll to obtain higher speeds of operation. the pll provides a significant amount of flexibility in selecting the device operating speed. a block diagram of the pll is shown in figure 8-2. the output of the primary oscillator or frc, denoted as ?f in ?, is divided down by a prescale factor (n1) of 2, 3, ... or 33 before being provided to the pll?s voltage controlled oscillator (vco). the input to the vco must be selected to be in the range of 0.8 mhz to 8 mhz. since the minimum prescale factor is 2, this implies that f in must be chosen to be in the range of 1.6 mhz to 16 mhz. the prescale factor ?n1? is selected using the pllpre<4:0> bits (clkdiv<4:0>). the pll feedback divisor, selected using the plldiv<8:0> bits (pllfbd<8:0>), provides a factor ?m?, by which the input to the vco is multiplied. this factor must be selected such that the resulting vco output frequency is in the range of 100 mhz to 200 mhz. the vco output is further divided by a postscale factor ?n2?. this factor is selected using the pllpost<1:0> bits (clkdiv<7:6>). ?n2? can be either 2, 4 or 8, and must be selected such that the pll output frequency (f osc ) is in the range of 12.5 mhz to 80 mhz, which generates device operating speeds of 6.25-40 mips. for a primary oscillator or frc oscillator, output ?f in ?, the pll output ?f osc ? is given by: equation 8-2: f osc calculation f cy = f osc /2 ( ) m n1*n2 f osc = f in *
? 2007 microchip technology inc. ds70286a-page 137 dspic33fjxxxgpx06/x08/x10 for example, suppose a 10 mhz crystal is being used, with ?xt with pll? being the selected oscillator mode. if pllpre<4:0> = 0, then n1 = 2. this yields a vco input of 10/2 = 5 mhz, which is within the acceptable range of 0.8-8 mhz. if plldiv<8:0> = 0x1e, then m = 32. this yields a vco output of 5 x 32 = 160 mhz, which is within the 100-200 mhz range needed. if pllpost<1:0> = 0, then n2 = 2. this provides a fosc of 160/2 = 80 mhz. the resultant device operating speed is 80/2 = 40 mips. equation 8-3: xt with pll mode example figure 8-2: dspic33fjxxxgpx0 6/x08/x10 pll block diagram table 8-1: configuration bit va lues for clock selection f cy = f osc = 1 ( 10000000*32 ) = 40 mips 2 2 2*2 oscillator mode oscillator source poscmd<1:0> fnosc<2:0> note fast rc oscillator with divide-by-n (frcdivn) internal xx 111 1, 2 fast rc oscillator with divide-by-16 (frcdiv16) internal xx 110 1 low-power rc oscillator (lprc) internal xx 101 1 secondary (timer1) oscillator (sosc) secondary xx 100 1 primary oscillator (hs) with pll (hspll) primary 10 011 primary oscillator (xt) with pll (xtpll) primary 01 011 primary oscillator (ec) with pll (ecpll) primary 00 011 1 primary oscillator (hs) primary 10 010 primary oscillator (xt) primary 01 010 primary oscillator (ec) primary 00 010 1 fast rc oscillator with pll (frcpll) internal xx 001 1 fast rc oscillator (frc) internal xx 000 1 note 1: osc2 pin function is determined by the osciofnc configuration bit. 2: this is the default oscillator mode for an unprogrammed (erased) device. 0.8-8.0 mhz here 100-200 mhz here divide by 2, 4, 8 divide by 2-513 divide by 2-33 1.6-16.0 mhz source (crystal, external clock pllpre xvco plldiv pllpost or internal rc) here 12.5-80 mhz here f osc
dspic33fjxxxgpx06/x08/x10 ds70286a-page 138 ? 2007 microchip technology inc. register 8-1: osccon: os cillator control register u-0 r-0 r-0 r-0 u-0 r/w-y r/w-y r/w-y ?cosc<2:0> ?nosc<2:0> bit 15 bit 8 r/w-0 u-0 r-0 u-0 r/c-0 u-0 r/w-0 r/w-0 clklock ?lock ?cf ? lposcen oswen bit 7 bit 0 legend: y = value set from configuration bits on por r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 cosc<2:0>: current oscillator selection bits (read-only) 000 = fast rc oscillator (frc) 001 = fast rc oscillator (frc) with pll 010 = primary oscillator (xt, hs, ec) 011 = primary oscillator (xt, hs, ec) with pll 100 = secondary oscillator (sosc) 101 = low-power rc oscillator (lprc) 110 = fast rc oscillator (frc) with divide-by-16 111 = fast rc oscillator (frc) with divide-by-n bit 11 unimplemented: read as ? 0 ? bit 10-8 nosc<2:0>: new oscillator selection bits 000 = fast rc oscillator (frc) 001 = fast rc oscillator (frc) with pll 010 = primary oscillator (xt, hs, ec) 011 = primary oscillator (xt, hs, ec) with pll 100 = secondary oscillator (sosc) 101 = low-power rc oscillator (lprc) 110 = fast rc oscillator (frc) with divide-by-16 111 = fast rc oscillator (frc) with divide-by-n bit 7 clklock: clock lock enable bit 1 = if (fcksm0 = 1 ), then clock and pll configurations are locked. if (fcksm0 = 0 ), then clock and pll configurations may be modified. 0 = clock and pll selections are not locked, configurations may be modified bit 6 unimplemented: read as ? 0 ? bit 5 lock: pll lock status bit (read-only) 1 = indicates that pll is in lock, or pll start-up timer is satisfied 0 = indicates that pll is out of lock, start-up timer is in progress or pll is disabled bit 4 unimplemented: read as ? 0 ? bit 3 cf: clock fail detect bit (read/clear by application) 1 = fscm has detected clock failure 0 = fscm has not detected clock failure bit 2 unimplemented: read as ? 0 ? bit 1 lposcen: secondary (lp) oscillator enable bit 1 = enable secondary oscillator 0 = disable secondary oscillator bit 0 oswen: oscillator switch enable bit 1 = request oscillator switch to selection specified by nosc<2:0> bits 0 = oscillator switch is complete
? 2007 microchip technology inc. ds70286a-page 139 dspic33fjxxxgpx06/x08/x10 register 8-2: clkdiv: clock divisor register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-0 r/w-0 roi doze<2:0> dozen (1) frcdiv<2:0> bit 15 bit 8 r/w-0 r/w-1 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pllpost<1:0> ? pllpre<4:0> bit 7 bit 0 legend: y = value set from configuration bits on por r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 roi: recover on interrupt bit 1 = interrupts will clear the dozen bit and the processor clock/peripheral clock ratio is set to 1:1 0 = interrupts have no effect on the dozen bit bit 14-12 doze<2:0>: processor clock reduction select bits 000 = f cy /1 001 = f cy /2 010 = f cy /4 011 = f cy /8 (default) 100 = f cy /16 101 = f cy /32 110 = f cy /64 111 = f cy /128 bit 11 dozen: doze mode enable bit (1) 1 = doze<2:0> field specifies the ratio between the peripheral clocks and the processor clocks 0 = processor clock/peripheral clock ratio forced to 1:1 bit 10-8 frcdiv<2:0>: internal fast rc oscillator postscaler bits 000 = frc divide by 1 (default) 001 = frc divide by 2 010 = frc divide by 4 011 = frc divide by 8 100 = frc divide by 16 101 = frc divide by 32 110 = frc divide by 64 111 = frc divide by 256 bit 7-6 pllpost<1:0>: pll vco output divider select bits (also denoted as ?n2?, pll postscaler) 00 = output/2 01 = output/4 (default) 10 = reserved 11 = output/8 bit 5 unimplemented: read as ? 0 ? bit 4-0 pllpre<4:0>: pll phase detector input divider bits (also denoted as ?n1?, pll prescaler) 00000 = input/2 (default) 00001 = input/3 ? ? ? 11111 = input/33 note 1: this bit is cleared when the roi bit is set and an interrupt occurs.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 140 ? 2007 microchip technology inc. register 8-3: pllfbd: pll feedback divisor register u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 (1) ? ? ? ? ? ? ?plldiv<8> bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 plldiv<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-9 unimplemented: read as ? 0 ? bit 8-0 plldiv<8:0>: pll feedback divisor bits (also denoted as ?m?, pll multiplier) 000000000 = 2 000000001 = 3 000000010 = 4 ? ? ? 000110000 = 50 (default) ? ? ? 111111111 = 513
? 2007 microchip technology inc. ds70286a-page 141 dspic33fjxxxgpx06/x08/x10 register 8-4: osctun: frc oscillator tuning register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? tun5 tun4 tun3 tun2 tun1 tun0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as ? 0 ? bit 5-0 tun<5:0>: frc oscillator tuning bits 011111 = center frequency + 11.625% 011110 = center frequency + 11.25% (8.23 mhz) ? ? ? 000001 = center frequency + 0.375% (7.40 mhz) 000000 = center frequency (7.37 mhz nominal) 111111 = center frequency ? 0.375% (7.345 mhz) ? ? ? 100001 = center frequency ? 11.625% (6.52 mhz) 100000 = center frequency ? 12% (6.49 mhz)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 142 ? 2007 microchip technology inc. 8.2 clock switching operation applications are free to switch between any of the four clock sources (primary, lp, frc and lprc) under software control at any time. to limit the possible side effects that could result from this flexibility, dspic33fjxxxgpx06/x08/x10 devices have a safe- guard lock built into the switch process. 8.2.1 enabling clock switching to enable clock switching, the fcksm1 configuration bit in the configuration register must be programmed to ? 0 ?. (refer to section 21.1 ?configuration bits? for further details.) if the fcksm1 configuration bit is unprogrammed (? 1 ?), the clock switching function and fail-safe clock monitor function are disabled. this is the default setting. the nosc control bits (osccon<10:8>) do not control the clock selection when clock switching is disabled. however, the cosc bits (osccon<14:12>) reflect the clock source selected by the fnosc configuration bits. the oswen control bit (osccon<0>) has no effect when clock switching is disabled. it is held at ? 0 ? at all times. 8.2.2 oscillator switching sequence at a minimum, performing a clock switch requires this basic sequence: 1. if desired, read the cosc bits (osccon<14:12>) to determine the current oscillator source. 2. perform the unlock sequence to allow a write to the osccon register high byte. 3. write the appropriate value to the nosc control bits (osccon<10:8>) for the new oscillator source. 4. perform the unlock sequence to allow a write to the osccon register low byte. 5. set the oswen bit to initiate the oscillator switch. once the basic sequence is completed, the system clock hardware responds automatically as follows: 1. the clock switching hardware compares the cosc status bits with the new value of the nosc control bits. if they are the same, then the clock switch is a redundant operation. in this case, the oswen bit is cleared automatically and the clock switch is aborted. 2. if a valid clock switch has been initiated, the lock (osccon<5>) and the cf (osccon<3>) status bits are cleared. 3. the new oscillator is turned on by the hardware if it is not currently running. if a crystal oscillator must be turned on, the hardware waits until the oscillator start-up timer (ost) expires. if the new source is using the pll, the hardware waits until a pll lock is detected (lock = 1 ). 4. the hardware waits for 10 clock cycles from the new clock source and then performs the clock switch. 5. the hardware clears the oswen bit to indicate a successful clock transition. in addition, the nosc bit values are transferred to the cosc status bits. 6. the old clock source is turned off at this time, with the exception of lprc (if wdt or fscm are enabled) or lp (if lposcen remains set). 8.3 fail-safe clock monitor (fscm) the fail-safe clock monitor (fscm) allows the device to continue to operate even in the event of an oscillator failure. the fscm function is enabled by programming. if the fscm function is enabled, the lprc internal oscillator runs at all times (except during sleep mode) and is not subject to control by the watchdog timer. in the event of an oscillator failure, the fscm generates a clock failure trap event and switches the system clock over to the frc oscillator. then the application program can either attempt to restart the oscillator or execute a controlled shutdown. the trap can be treated as a warm reset by simply loading the reset address into the oscillator fail trap vector. if the pll multiplier is used to scale the system clock, the internal frc is also multiplied by the same factor on clock failure. essentially, the device switches to frc with pll on a clock failure. note: primary oscillator mode has three different submodes (xt, hs and ec) which are determined by the poscmd<1:0> config- uration bits. while an application can switch to and from primary oscillator mode in software, it cannot switch between the different primary submodes without reprogramming the device. note 1: the processor continues to execute code throughout the clock switching sequence. timing sensitive code should not be executed during this time. 2: direct clock switches between any primary oscillator mode with pll and frcpll mode are not permitted. this applies to clock switches in either direction. in these instances, the application must switch to frc mode as a transition clock source between the two pll modes.
? 2007 microchip technology inc. ds70286a-page 143 dspic33fjxxxgpx06/x08/x10 9.0 power-saving features the dspic33fjxxxgpx06/x08/x10 devices provide the ability to manage power consumption by selectively managing clocking to the cpu and the peripherals. in general, a lower clock frequency and a reduction in the number of circuits being clocked constitutes lower con- sumed power. dspic33fjxxxgpx06/x08/x10 devices can manage power consumption in four differ- ent ways: ? clock frequency ? instruction-based sleep and idle modes ? software-controlled doze mode ? selective peripheral control in software combinations of these methods can be used to selec- tively tailor an application?s power consumption while still maintaining critical application features, such as timing-sensitive communications. 9.1 clock frequency and clock switching dspic33fjxxxgpx06/x08/x10 devices allow a wide range of clock frequencies to be selected under appli- cation control. if the system clock configuration is not locked, users can choose low-power or high-precision oscillators by simply changing the nosc bits (osc- con<10:8>). the process of changing a system clock during operation, as well as limitations to the process, are discussed in more detail in section 8.0 ?oscillator configuration? . 9.2 instruction-based power-saving modes dspic33fjxxxgpx06/x08/x10 devices have two special power-saving modes that are entered through the execution of a special pwrsav instruction. sleep mode stops clock operation and halts all code execu- tion. idle mode halts the cpu and code execution, but allows peripheral modules to continue operation. the assembly syntax of the pwrsav instruction is shown in example 9-1. sleep and idle modes can be exited as a result of an enabled interrupt, wdt time-out or a device reset. when the device exits these modes, it is said to ?wake-up?. 9.2.1 sleep mode sleep mode has these features: ? the system clock source is shut down. if an on-chip oscillator is used, it is turned off. ? the device current consumption is reduced to a minimum, provided that no i/o pin is sourcing current. ? the fail-safe clock monitor does not operate during sleep mode since the system clock source is disabled. ? the lprc clock continues to run in sleep mode if the wdt is enabled. ? the wdt, if enabled, is automatically cleared prior to entering sleep mode. ? some device features or peripherals may continue to operate in sleep mode. this includes items such as the input change notification on the i/o ports, or peripherals that use an external clock input. any peripheral that requires the system clock source for its operation is disabled in sleep mode. the device will wake-up from sleep mode on any of the these events: ? any interrupt source that is individually enabled. ? any form of device reset. ? a wdt time-out. on wake-up from sleep, the processor restarts with the same clock source that was active when sleep mode was entered. example 9-1: pwrsav instruction syntax note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note: sleep_mode and idle_mode are constants defined in the assembler include file for the selected device. pwrsav #sleep_mode ; put the device into sleep mode pwrsav #idle_mode ; put the device into idle mode
dspic33fjxxxgpx06/x08/x10 ds70286a-page 144 ? 2007 microchip technology inc. 9.2.2 idle mode idle mode has these features: ? the cpu stops executing instructions. ? the wdt is automatically cleared. ? the system clock source remains active. by default, all peripheral modules continue to operate normally from the system clock source, but can also be selectively disabled (see section 9.4 ?peripheral module disable? ). ? if the wdt or fscm is enabled, the lprc also remains active. the device will wake from idle mode on any of these events: ? any interrupt that is individually enabled. ? any device reset. ? a wdt time-out. on wake-up from idle, the clock is reapplied to the cpu and instruction execution begins immediately, starting with the instruction following the pwrsav instruction, or the first instruction in the isr. 9.2.3 interrupts coincident with power save instructions any interrupt that coincides with the execution of a pwrsav instruction is held off until entry into sleep or idle mode has completed. the device then wakes up from sleep or idle mode. 9.3 doze mode generally, changing clock speed and invoking one of the power-saving modes are the preferred strategies for reducing power consumption. there may be cir- cumstances, however, where this is not practical. for example, it may be necessary for an application to main- tain uninterrupted synchronous communication, even while it is doing nothing else. reducing system clock speed may introduce communication errors, while using a power-saving mode may stop communications completely. doze mode is a simple and effective alternative method to reduce power consumption while the device is still executing code. in this mode, the system clock contin- ues to operate from the same source and at the same speed. peripheral modules continue to be clocked at the same speed, while the cpu clock speed is reduced. synchronization between the two clock domains is maintained, allowing the peripherals to access the sfrs while the cpu executes code at a slower rate. doze mode is enabled by setting the dozen bit (clkdiv<11>). the ratio between peripheral and core clock speed is determined by the doze<2:0> bits (clkdiv<14:12>). there are eight possible configurations, from 1:1 to 1:128, with 1:1 being the default setting. it is also possible to use doze mode to selectively reduce power consumption in event-driven applica- tions. this allows clock-sensitive functions, such as synchronous communications, to continue without interruption while the cpu idles, waiting for something to invoke an interrupt routine. enabling the automatic return to full-speed cpu operation on interrupts is enabled by setting the roi bit (clkdiv<15>). by default, interrupt events have no effect on doze mode operation. for example, suppose the device is operating at 20 mips and the can module has been configured for 500 kbps based on this device operating speed. if the device is now placed in doze mode with a clock frequency ratio of 1:4, the can module continues to communicate at the required bit rate of 500 kbps, but the cpu now starts executing instructions at a frequency of 5 mips. 9.4 peripheral module disable the peripheral module disable (pmd) registers provide a method to disable a peripheral module by stopping all clock sources supplied to that module. when a peripheral is disabled via the appropriate pmd control bit, the peripheral is in a minimum power consumption state. the control and status registers associated with the peripheral are also disabled, so writes to those registers will have no effect and read values will be invalid. a peripheral module is only enabled if both the associ- ated bit in the pmd register is cleared and the peripheral is supported by the specific dspic ? dsc variant. if the peripheral is present in the device, it is enabled in the pmd register by default. note: if a pmd bit is set, the corresponding mod- ule is disabled after a delay of 1 instruction cycle. similarly, if a pmd bit is cleared, the corresponding module is enabled after a delay of 1 instruction cycle (assuming the module control registers are already configured to enable module operation).
? 2007 microchip technology inc. ds70286a-page 145 dspic33fjxxxgpx06/x08/x10 10.0 i/o ports all of the device pins (except v dd , v ss , mclr and osc1/clkin) are shared between the peripherals and the parallel i/o ports. all i/o input ports feature schmitt trigger inputs for improved noise immunity. 10.1 parallel i/o (pio) ports a parallel i/o port that shares a pin with a peripheral is, in general, subservient to the peripheral. the periph- eral?s output buffer data and control signals are provided to a pair of multiplexers. the multiplexers select whether the peripheral or the associated port has ownership of the output data and control signals of the i/o pin. the logic also prevents ?loop through?, in which a port?s digital output can drive the input of a peripheral that shares the same pin. figure 10-1 shows how ports are shared with other peripherals and the associated i/o pin to which they are connected. when a peripheral is enabled and actively driving an associated pin, the use of the pin as a general purpose output pin is disabled. the i/o pin may be read, but the output driver for the parallel port bit will be disabled. if a peripheral is enabled, but the peripheral is not actively driving a pin, that pin may be driven by a port. all port pins have three registers directly associated with their operation as digital i/o. the data direction register (trisx) determines whether the pin is an input or an output. if the data direction bit is a ? 1 ?, then the pin is an input. all port pins are defined as inputs after a reset. reads from the latch (latx), read the latch. writes to the latch, write the latch. reads from the port (portx), read the port pins, while writes to the port pins, write the latch. any bit and its associated data and control registers that are not valid for a particular device will be disabled. that means the corresponding latx and trisx registers and the port pins will read as zeros. when a pin is shared with another peripheral or func- tion that is defined as an input only, it is nevertheless regarded as a dedicated port because there is no other competing source of outputs. an example is the int4 pin. figure 10-1: block diag ram of a typical shared port structure note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note: the voltage on a digital input pin can be between -0.3v to 5.6v. q d ck wr lat + tris latch i/o pin wr port data bus q d ck data latch read port read tris 1 0 1 0 wr tris peripheral output data output enable peripheral input data i/o peripheral module peripheral output enable pio module output multiplexers output data input data peripheral module enable read lat
dspic33fjxxxgpx06/x08/x10 ds70286a-page 146 ? 2007 microchip technology inc. 10.2 open-drain configuration in addition to the port, lat and tris registers for data control, each port pin can also be individually configured for either digital or open-drain output. this is controlled by the open-drain control register, odcx, associated with each port. setting any of the bits con- figures the corresponding pin to act as an open-drain output. the open-drain feature allows the generation of outputs higher than v dd (e.g., 5v) on any desired digi- tal only pins by using external pull-up resistors. (the open-drain i/o feature is not supported on pins which have analog functionality multiplexed on the pin.) the maximum open-drain voltage allowed is the same as the maximum v ih specification. the open-drain output feature is supported for both port pin and peripheral configurations. 10.3 configuring analog port pins the use of the adxpcfgh, adxpcfgl and tris registers control the operation of the adc port pins. the port pins that are desired as analog inputs must have their corresponding tris bit set (input). if the tris bit is cleared (output), the digital output level (v oh or v ol ) is converted. clearing any bit in the adxpcfgh or adxpcfgl reg- ister configures the corresponding bit to be an analog pin. this is also the reset state of any i/o pin that has an analog (anx) function associated with it. when reading the port register, all pins configured as analog input channels will read as cleared (a low level). pins configured as digital inputs will not convert an analog input. analog levels on any pin that is defined as a digital input (including the anx pins) can cause the input buffer to consume current that exceeds the device specifications. 10.4 i/o port write/read timing one instruction cycle is required between a port direction change or port write operation and a read operation of the same port. typically, this instruction would be a nop . 10.5 input change notification the input change notification function of the i/o ports allows the dspic33fjxxxgpx06/x08/x10 devices to generate interrupt requests to the processor in response to a change-of-state on selected input pins. this feature is capable of detecting input change-of-states even in sleep mode, when the clocks are disabled. depending on the device pin count, there are up to 24 external signals (cn0 through cn23) that can be selected (enabled) for generating an interrupt request on a change-of-state. there are four control registers associated with the cn module. the cnen1 and cnen2 registers contain the cn interrupt enable (cnxie) control bits for each of the cn input pins. setting any of these bits enables a cn interrupt for the corresponding pins. each cn pin also has a weak pull-up connected to it. the pull-ups act as a current source that is connected to the pin and eliminate the need for external resistors when push button or keypad devices are connected. the pull-ups are enabled separately using the cnpu1 and cnpu2 registers, which contain the weak pull-up enable (cnxpue) bits for each of the cn pins. setting any of the control bits enables the weak pull-ups for the corresponding pins. example 10-1: port write/read example note: in devices with two adc modules, if the corresponding pcfg bit in either ad1pcfgh(l) and ad2pcfgh(l) is cleared, the pin is configured as an analog input. note: the voltage on an analog input pin can be between -0.3v to (v dd + 0.3 v). note: pull-ups on change notification pins should always be disabled whenever the port pin is configured as a digital output. mov 0xff00, w0 ; configure portb<15:8> as inputs mov w0, trisbb ; and portb<7:0> as outputs nop ; delay 1 cycle btss portb, #13 ; next instruction
? 2007 microchip technology inc. ds70286a-page 147 dspic33fjxxxgpx06/x08/x10 11.0 timer1 the timer1 module is a 16-bit timer, which can serve as the time counter for the real-time clock, or operate as a free-running interval timer/counter. timer1 can operate in three modes: ? 16-bit timer ? 16-bit synchronous counter ? 16-bit asynchronous counter timer1 also supports these features: ? timer gate operation ? selectable prescaler settings ? timer operation during cpu idle and sleep modes ? interrupt on 16-bit period register match or falling edge of external gate signal figure 11-1 presents a block diagram of the 16-bit timer module. to configure timer1 for operation: 1. set the ton bit (= 1 ) in the t1con register. 2. select the timer prescaler ratio using the tckps<1:0> bits in the t1con register. 3. set the clock and gating modes using the tcs and tgate bits in the t1con register. 4. set or clear the tsync bit in t1con to select synchronous or asynchronous operation. 5. load the timer period value into the pr1 register. 6. if interrupts are required, set the interrupt enable bit, t1ie. use the priority bits, t1ip<2:0>, to set the interrupt priority. figure 11-1: 16-bit time r1 module block diagram note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. ton sosci sosco/ pr1 set t1if equal comparator tmr1 reset soscen 1 0 tsync q qd ck tckps<1:0> prescaler 1, 8, 64, 256 2 tgate t cy 1 0 t1ck tcs 1x 01 tgate 00 sync gate sync
dspic33fjxxxgpx06/x08/x10 ds70286a-page 148 ? 2007 microchip technology inc. register 11-1: t1con: timer1 control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton ?tsidl ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 u-0 ? tgate tckps<1:0> ? tsync tcs ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timer1 on bit 1 = starts 16-bit timer1 0 = stops 16-bit timer1 bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timer1 gated time accumulation enable bit when t1cs = 1 : this bit is ignored. when t1cs = 0 : 1 = gated time accumulation enabled 0 = gated time accumulation disabled bit 5-4 tckps<1:0> timer1 input clock prescale select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3 unimplemented: read as ? 0 ? bit 2 tsync: timer1 external clock input synchronization select bit when tcs = 1 : 1 = synchronize external clock input 0 = do not synchronize external clock input when tcs = 0 : this bit is ignored. bit 1 tcs: timer1 clock source select bit 1 = external clock from pin t1ck (on the rising edge) 0 = internal clock (f cy ) bit 0 unimplemented: read as ? 0 ?
? 2007 microchip technology inc. ds70286a-page 149 dspic33fjxxxgpx06/x08/x10 12.0 timer2/3, timer4/5, timer6/7 and timer8/9 the timer2/3, timer4/5, timer6/7 and timer8/9 modules are 32-bit timers, which can also be config- ured as four independent 16-bit timers with selectable operating modes. as a 32-bit timer, timer2/3, timer4/5, timer6/7 and timer8/9 operate in three modes: ? two independent 16-bit timers (e.g., timer2 and timer3) with all 16-bit operating modes (except asynchronous counter mode) ? single 32-bit timer ? single 32-bit synchronous counter they also support these features: ? timer gate operation ? selectable prescaler settings ? timer operation during idle and sleep modes ? interrupt on a 32-bit period register match ? time base for input capture and output compare modules (timer2 and timer3 only) ? adc1 event trigger (timer2/3 only) ? adc2 event trigger (timer4/5 only) individually, all eight of the 16-bit timers can function as synchronous timers or counters. they also offer the features listed above, except for the event trigger; this is implemented only with timer2/3. the operating modes and enabled features are determined by setting the appropriate bit(s) in the t2con, t3con, t4con, t5con, t6con, t7con, t8con and t9con regis- ters. t2con, t4con, t6con and t8con are shown in generic form in register 12-1. t3con, t5con, t7con and t9con are shown in register 12-2. for 32-bit timer/counter operation, timer2, timer4, timer6 or timer8 is the least significant word; timer3, timer5, timer7 or timer9 is the most significant word of the 32-bit timers. to configure timer2/3, timer4/5, timer6/7 or timer8/9 for 32-bit operation: 1. set the corresponding t32 control bit. 2. select the prescaler ratio for timer2, timer4, timer6 or timer8 using the tckps<1:0> bits. 3. set the clock and gating modes using the corresponding tcs and tgate bits. 4. load the timer period value. pr3, pr5, pr7 or pr9 contains the most significant word of the value, while pr2, pr4, pr6 or pr8 contains the least significant word. 5. if interrupts are required, set the interrupt enable bit, t3ie, t5ie, t7ie or t9ie. use the priority bits, t3ip<2:0>, t5ip<2:0>, t7ip<2:0> or t9ip<2:0>, to set the interrupt priority. while timer2, timer4, timer6 or timer8 control the timer, the interrupt appears as a timer3, timer5, timer7 or timer9 interrupt. 6. set the corresponding ton bit. the timer value at any point is stored in the register pair, tmr3:tmr2, tmr5:tmr4, tmr7:tmr6 or tmr9:tmr8. tmr3, tmr5, tmr7 or tmr9 always contains the most significant word of the count, while tmr2, tmr4, tmr6 or tmr8 contains the least significant word. to configure any of the timers for individual 16-bit operation: 1. clear the t32 bit corresponding to that timer. 2. select the timer prescaler ratio using the tckps<1:0> bits. 3. set the clock and gating modes using the tcs and tgate bits. 4. load the timer period value into the prx register. 5. if interrupts are required, set the interrupt enable bit, txie. use the priority bits, txip<2:0>, to set the interrupt priority. 6. set the ton bit. a block diagram for a 32-bit timer pair (timer4/5) example is shown in figure 12-1 and a timer (timer4) operating in 16-bit mode example is shown in figure 12-2. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note: for 32-bit operation, t3con, t5con, t7con and t9con control bits are ignored. only t2con, t4con, t6con and t8con control bits are used for setup and control. timer2, timer4, timer6 and timer8 clock and gate inputs are utilized for the 32-bit timer modules, but an inter- rupt is generated with the timer3, timer5, ttimer7 and timer9 interrupt flags. note: only timer2 and timer3 can trigger a dma data transfer.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 150 ? 2007 microchip technology inc. figure 12-1: timer2/3 (32-bit) block diagram (1) set t3if equal comparator pr3 pr2 reset lsb msb note 1: the 32-bit timer control bit, t32, must be set for 32-bit timer/counter operation. all control bits are respective to the t2con register. 2: the adc event trigger is available only on timer2/3. data bus<15:0> tmr3hld read tmr2 write tmr2 16 16 16 q qd ck tgate 0 1 ton tckps<1:0> 2 t cy tcs 1x 01 tgate 00 t2ck adc event trigger (2) gate sync prescaler 1, 8, 64, 256 sync tmr3 tmr2 16
? 2007 microchip technology inc. ds70286a-page 151 dspic33fjxxxgpx06/x08/x10 figure 12-2: timer2 ( 16-bit) block diagram ton tckps<1:0> prescaler 1, 8, 64, 256 2 t cy tcs tgate t2ck pr2 set t2if equal comparator tmr2 reset q qd ck tgate 1 0 gate sync 1x 01 00 sync
dspic33fjxxxgpx06/x08/x10 ds70286a-page 152 ? 2007 microchip technology inc. register 12-1: txcon (t2con, t4con, t6con or t8con) control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton ?tsidl ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 u-0 ? tgate tckps<1:0> t32 (1) ?tcs ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timerx on bit when t32 = 1 : 1 = starts 32-bit timerx/y 0 = stops 32-bit timerx/y when t32 = 0 : 1 = starts 16-bit timerx 0 = stops 16-bit timerx bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timerx gated time accumulation enable bit when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation enabled 0 = gated time accumulation disabled bit 5-4 tckps<1:0>: timerx input clock prescale select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3 t32: 32-bit timer mode select bit (1) 1 = timerx and timery form a single 32-bit timer 0 = timerx and timery act as two 16-bit timers bit 2 unimplemented: read as ? 0 ? bit 1 tcs: timerx clock source select bit 1 = external clock from pin txck (on the rising edge) 0 = internal clock (f cy ) bit 0 unimplemented: read as ? 0 ? note 1: in 32-bit mode, t3con control bits do not affect 32-bit timer operation.
? 2007 microchip technology inc. ds70286a-page 153 dspic33fjxxxgpx06/x08/x10 register 12-2: tycon (t3con, t5con, t7con or t9con) control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton (1) ?tsidl (1) ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 ?tgate (1) tckps<1:0> (1) ? ?tcs (1) ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timery on bit (1) 1 = starts 16-bit timery 0 = stops 16-bit timery bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: stop in idle mode bit (1) 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timery gated time accumulation enable bit (1) when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation enabled 0 = gated time accumulation disabled bit 5-4 tckps<1:0>: timer3 input clock prescale select bits (1) 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3-2 unimplemented: read as ? 0 ? bit 1 tcs: timery clock source select bit (1) 1 = external clock from pin tyck (on the rising edge) 0 = internal clock (f cy ) bit 0 unimplemented: read as ? 0 ? note 1: when 32-bit operation is enabled (t2con<3> = 1 ), these bits have no effect on timery operation; all timer functions are set through t2con.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 154 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 155 dspic33fjxxxgpx06/x08/x10 13.0 input capture the input capture module is useful in applications requiring frequency (period) and pulse measurement. the dspic33fjxxxgpx06/x08/x10 devices support up to eight input capture channels. the input capture module captures the 16-bit value of the selected time base register when an event occurs at the icx pin. the events that cause a capture event are listed below in three categories: 1. simple capture event modes -capture timer value on every falling edge of input at icx pin -capture timer value on every rising edge of input at icx pin 2. capture timer value on every edge (rising and falling) 3. prescaler capture event modes -capture timer value on every 4th rising edge of input at icx pin -capture timer value on every 16th rising edge of input at icx pin each input capture channel can select between one of two 16-bit timers (timer2 or timer3) for the time base. the selected timer can use either an internal or external clock. other operational features include: ? device wake-up from capture pin during cpu sleep and idle modes ? interrupt on input capture event ? 4-word fifo buffer for capture values - interrupt optionally generated after 1, 2, 3 or 4 buffer locations are filled ? input capture can also be used to provide additional sources of external interrupts figure 13-1: input capture block diagram note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note: only ic1 and ic2 can trigger a dma data transfer. if dma data transfers are required, the fifo buffer size must be set to 1 (ici<1:0> = 00 ). icxbuf icx pin icm<2:0> (icxcon<2:0>) mode select 3 10 set flag icxif (in ifsn register) tmry tmrz edge detection logic 16 16 fifo r/w logic icxi<1:0> icov, icbne (icxcon<4:3>) icxcon interrupt logic system bus from 16-bit timers ictmr (icxcon<7>) fifo prescaler counter (1, 4, 16) and clock synchronizer note: an ?x? in a signal, register or bit nam e denotes the number of the capture channel.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 156 ? 2007 microchip technology inc. 13.1 input capture registers register 13-1: icxcon: input capture x control register u-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ? ?icsidl ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r-0, hc r-0, hc r/w-0 r/w-0 r/w-0 ictmr (1) ici<1:0> icov icbne icm<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 icsidl: input capture module stop in idle control bit 1 = input capture module will halt in cpu idle mode 0 = input capture module will continue to operate in cpu idle mode bit 12-8 unimplemented: read as ? 0 ? bit 7 ictmr: input capture timer select bits (1) 1 = tmr2 contents are captured on capture event 0 = tmr3 contents are captured on capture event bit 6-5 ici<1:0>: select number of captures per interrupt bits 11 = interrupt on every fourth capture event 10 = interrupt on every third capture event 01 = interrupt on every second capture event 00 = interrupt on every capture event bit 4 icov: input capture overflow status flag bit (read-only) 1 = input capture overflow occurred 0 = no input capture overflow occurred bit 3 icbne: input capture buffer empty status bit (read-only) 1 = input capture buffer is not empty, at least one more capture value can be read 0 = input capture buffer is empty bit 2-0 icm<2:0>: input capture mode select bits 111 =input capture functions as interrupt pin only when device is in sleep or idle mode (rising edge detect only, all other control bits are not applicable.) 110 =unused (module disabled) 101 =capture mode, every 16th rising edge 100 =capture mode, every 4th rising edge 011 =capture mode, every rising edge 010 =capture mode, every falling edge 001 =capture mode, every edge (rising and falling) (ici<1:0> bits do not control interrupt generation for this mode.) 000 =input capture module turned off note 1: timer selections may vary. refer to the device data sheet for details.
? 2007 microchip technology inc. ds70286a-page 157 dspic33fjxxxgpx06/x08/x10 14.0 output compare 14.1 setup for single output pulse generation when the ocm control bits (ocxcon<2:0>) are set to ? 100 ?, the selected output compare channel initializes the ocx pin to the low state and generates a single output pulse. to generate a single output pulse, the following steps are required (these steps assume timer source is initially turned off but this is not a requirement for the module operation): 1. determine the instruction clock cycle time. take into account the frequency of the external clock to the timer source (if one is used) and the timer prescaler settings. 2. calculate time to the rising edge of the output pulse relative to the tmry start value (0000h). 3. calculate the time to the falling edge of the pulse based on the desired pulse width and the time to the rising edge of the pulse. 4. write the values computed in steps 2 and 3 above into the output compare register, ocxr, and the output compare secondary register, ocxrs, respectively. 5. set timer period register, pry, to value equal to or greater than value in ocxrs, the output compare secondary register. 6. set the ocm bits to ? 100 ? and the octsel (ocxcon<3>) bit to the desired timer source. the ocx pin state will now be driven low. 7. set the ton (tycon<15>) bit to ? 1 ?, which enables the compare time base to count. 8. upon the first match between tmry and ocxr, the ocx pin will be driven high. 9. when the incrementing timer, tmry, matches the output compare secondary register, ocxrs, the second and trailing edge (high-to-low) of the pulse is driven onto the ocx pin. no additional pulses are driven onto the ocx pin and it remains at low. as a result of the second compare match event, the ocxif interrupt flag bit is set, which will result in an interrupt if it is enabled, by setting the ocxie bit. for further information on peripheral interrupts, refer to section 6.0 ?interrupt controller? . 10. to initiate another single pulse output, change the timer and compare register settings, if needed, and then issue a write to set the ocm bits to ? 100 ?. disabling and re-enabling of the timer, and clearing the tmry register, are not required but may be advantageous for defining a pulse from a known event time boundary. the output compare module does not have to be dis- abled after the falling edge of the output pulse. another pulse can be initiated by rewriting the value of the ocxcon register. 14.2 setup for continuous output pulse generation when the ocm control bits (ocxcon<2:0>) are set to ? 101 ?, the selected output compare channel initializes the ocx pin to the low state and generates output pulses on each and every compare match event. for the user to configure the module for the generation of a continuous stream of output pulses, the following steps are required (these steps assume timer source is initially turned off but this is not a requirement for the module operation): 1. determine the instruction clock cycle time. take into account the frequency of the external clock to the timer source (if one is used) and the timer prescaler settings. 2. calculate time to the rising edge of the output pulse relative to the tmry start value (0000h). 3. calculate the time to the falling edge of the pulse, based on the desired pulse width and the time to the rising edge of the pulse. 4. write the values computed in step 2 and 3 above into the output compare register, ocxr, and the output compare secondary register, ocxrs, respectively. 5. set timer period register, pry, to a value equal to or greater than value in ocxrs, the output compare secondary register. 6. set the ocm bits to ? 101 ? and the octsel bit to the desired timer source. the ocx pin state will now be driven low. 7. enable the compare time base by setting the ton (tycon<15>) bit to ? 1 ?. 8. upon the first match between tmry and ocxr, the ocx pin will be driven high. 9. when the compare time base, tmry, matches the output compare secondary register, ocxrs, the second and trailing edge (high-to-low) of the pulse is driven onto the ocx pin. 10. as a result of the second compare match event, the ocxif interrupt flag bit is set. 11. when the compare time base and the value in its respective timer period register match, the tmry register resets to 0x0000 and resumes counting. 12. steps 8 through 11 are repeated and a continuous stream of pulses is generated, indefinitely. the ocxif flag is set on each ocxrs-tmry compare match event. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 158 ? 2007 microchip technology inc. 14.3 pulse-width modulation mode the following steps should be taken when configuring the output compare module for pwm operation: 1. set the pwm period by writing to the selected timer period register (pry). 2. set the pwm duty cycle by writing to the ocxrs register. 3. write the oxcr register with the initial duty cycle. 4. enable interrupts, if required, for the timer and output compare modules. the output compare interrupt is required for pwm fault pin utilization. 5. configure the output compare module for one of two pwm operation modes by writing to the out- put compare mode bits, ocm<2:0> (ocxcon<2:0>). 6. set the tmry prescale value and enable the time base by setting ton = 1 (txcon<15>). 14.3.1 pwm period the pwm period is specified by writing to pry, the timer period register. the pwm period can be calculated using equation 14-1: equation 14-1: calculating the pwm period 14.3.2 pwm duty cycle the pwm duty cycle is specified by writing to the ocxrs register. the ocxrs register can be written to at any time, but the duty cycle value is not latched into ocxr until a match between pry and tmry occurs (i.e., the period is complete). this provides a double buffer for the pwm duty cycle and is essential for glitchless pwm operation. in the pwm mode, ocxr is a read-only register. some important boundary parameters of the pwm duty cycle include: ? if the output compare register, ocxr, is loaded with 0000h, the ocx pin will remain low (0% duty cycle). ? if ocxr is greater than pry (timer period register), the pin will remain high (100% duty cycle). ? if ocxr is equal to pry, the ocx pin will be low for one time base count value and high for all other count values. see example 14-1 for pwm mode timing details. table 14-1 shows example pwm frequencies and resolutions for a device operating at 10 mips. equation 14-2: calculation fo r maximum pwm resolution example 14-1: pwm period and duty cycle calculations note: the ocxr register should be initialized before the output compare module is first enabled. the ocxr register becomes a read-only duty cycle register when the module is operated in the pwm modes. the value held in ocxr will become the pwm duty cycle for the first pwm period. the contents of the output compare secondary register, ocxrs, will not be transferred into ocxr until a time base period match occurs. note: a pry value of n will produce a pwm period of n + 1 time base count cycles. for example, a value of 7 written into the pry register will yield a period consisting of eight time base cycles. pwm period = [(pry) + 1] ? t cy ? (timer prescale value) pwm frequency = 1/[pwm period] where: ( ) maximum pwm resolution (bits) = f cy f pwm log 10 log 10 (2) bits 1. find the timer period register value for a desired pwm frequency that is 52.08 khz, where f cy = 16 mhz and a timer2 prescaler setting of 1:1. t cy = 62.5 ns pwm period = 1/pwm frequency = 1/52.08 khz = 19.2 s pwm period = (pr2 + 1) ? t cy ? (timer2 prescale value) 19.2 s = (pr2 + 1) ? 62.5 ns ? 1 pr2 = 306 2. find the maximum resolution of the duty cycle that can be us ed with a 52.08 khz frequency and a 32 mhz device clock rate: pwm resolution = log 10 (f cy /f pwm )/log 10 2) bits =(log 10 (16 mhz/52.08 khz)/log 10 2) bits = 8.3 bits
? 2007 microchip technology inc. ds70286a-page 159 dspic33fjxxxgpx06/x08/x10 table 14-1: example pwm frequencies and resolutions at 4 mips (f cy = 4 mhz) table 14-2: example pwm frequencies and resolutions at 16 mips (f cy = 16 mhz) table 14-3: example pwm frequencies and resolutions at 40 mips (f cy = 40 mhz) figure 14-1: output comp are module block diagram the corresponding trisx bits must be cleared to configure the associated i/o pins as oc outputs. pwm frequency 7.6 hz 61 hz 122 hz 977 hz 3.9 khz 31.3 khz 125 khz timer prescaler ratio 8111111 period register value ffffh ffffh 7fffh 0fffh 03ffh 007fh 001fh resolution (bits) 16 16 15 12 10 7 5 pwm frequency 30.5 hz 244 hz 488 hz 3.9 khz 15.6 khz 125 khz 500 khz timer prescaler ratio 8111111 period register value ffffh ffffh 7fffh 0fffh 03ffh 007fh 001fh resolution (bits) 16 16 15 12 10 7 5 pwm frequency 76 hz 610 hz 1.22 hz 9.77 khz 39 khz 313 khz 1.25 mhz timer prescaler ratio 8111111 period register value ffffh ffffh 7fffh 0fffh 03ffh 007fh 001fh resolution (bits) 16 16 15 12 10 7 5 ocxr (1) comparator output logic ocm2:ocm0 output enable ocx (1) set flag bit ocxif (1) ocxrs (1) mode select 3 note 1: where ?x? is shown, reference is made to the registers associated with the respective output compare channels 1 through 8. 2: ocfa pin controls oc1-oc4 channels. ocfb pin controls oc5-oc8 channels. 3: each output compare channel can use one of two selectable time bases. refer to the device data sheet for the time bases associated with the module. octsel 0 1 16 16 ocfa or ocfb (2) tmr register inputs from time bases (3) period match signals from time bases (3) 0 1 q s r note: only oc1 and oc2 can trigger a dma data transfer.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 160 ? 2007 microchip technology inc. 14.4 output compare register register 14-1: ocxcon: output compare x control register u-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ? ?ocsidl ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r-0 hc r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ocflt octsel (1) ocm<2:0> bit 7 bit 0 legend: hc = cleared in hardware hs = set in hardware r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 ocsidl: stop output compare in idle mode control bit 1 = output compare x will halt in cpu idle mode 0 = output compare x will continue to operate in cpu idle mode bit 12-5 unimplemented: read as ? 0 ? bit 4 ocflt: pwm fault condition status bit 1 = pwm fault condition has occurred (cleared in hw only) 0 = no pwm fault condition has occurred (this bit is only used when ocm<2:0> = 111 .) bit 3 octsel: output compare timer select bit (1) 1 = timer3 is the clock source for compare x 0 = timer2 is the clock source for compare x bit 2-0 ocm<2:0>: output compare mode select bits 111 = pwm mode on ocx, fault pin enabled 110 = pwm mode on ocx, fault pin disabled 101 = initialize ocx pin low, generate continuous output pulses on ocx pin 100 = initialize ocx pin low, generate single output pulse on ocx pin 011 = compare event toggles ocx pin 010 = initialize ocx pin high, compare event forces ocx pin low 001 = initialize ocx pin low, compare event forces ocx pin high 000 = output compare channel is disabled note 1: refer to the device data sheet for specific time bases available to the output compare module.
? 2007 microchip technology inc. ds70286a-page 161 dspic33fjxxxgpx06/x08/x10 15.0 serial peripheral interface (spi) the serial peripheral interface (spi) module is a synchronous serial interface useful for communicating with other peripheral or microcontroller devices. these peripheral devices may be serial eeproms, shift registers, display drivers, adc, etc. the spi module is compatible with spi and siop from motorola ? . each spi module consists of a 16-bit shift register, spixsr (where x = 1 or 2), used for shifting data in and out, and a buffer register, spixbuf. a control register, spixcon, configures the module. additionally, a status register, spixstat, indicates various status conditions. the serial interface consists of 4 pins: sdix (serial data input), sdox (serial data output), sckx (shift clock input or output), and ssx (active low slave select). in master mode operation, sck is a clock output but in slave mode, it is a clock input. a series of eight (8) or sixteen (16) clock pulses shift out bits from the spixsr to sdox pin and simultaneously shift in data from sdix pin. an interrupt is generated when the transfer is complete and the corresponding interrupt flag bit (spi1if or spi2if) is set. this interrupt can be disabled through an interrupt enable bit (spi1ie or spi2ie). the receive operation is double-buffered. when a com- plete byte is received, it is transferred from spixsr to spixbuf. if the receive buffer is full when new data is being trans- ferred from spixsr to spixbuf, the module will set the spirov bit indicating an overflow condition. the transfer of the data from spixsr to spixbuf will not be com- pleted and the new data will be lost. the module will not respond to scl transitions while spirov is ? 1 ?, effec- tively disabling the module until spixbuf is read by user software. transmit writes are also double-buffered. the user writes to spixbuf. when the master or slave transfer is com- pleted, the contents of the shift register (spixsr) are moved to the receive buffer. if any transmit data has been written to the buffer register, the contents of the transmit buffer are moved to spixsr. the received data is thus placed in spixbuf and the transmit data in spixsr is ready for the next transfer. to set up the spi module for the master mode of operation: 1. if using interrupts: a) clear the spixif bit in the respective ifsn register. b) set the spixie bit in the respective iecn register. c) write the spixip bits in the respective ipcn register to set the interrupt priority. 2. write the desired settings to the spixcon register with msten (spixcon1<5>) = 1 . 3. clear the spirov bit (spixstat<6>). 4. enable spi operation by setting the spien bit (spixstat<15>). 5. write the data to be transmitted to the spixbuf register. transmission (and reception) will start as soon as data is written to the spixbuf register. to set up the spi module for the slave mode of operation: 1. clear the spixbuf register. 2. if using interrupts: a) clear the spixif bit in the respective ifsn register. b) set the spixie bit in the respective iecn register. c) write the spixip bits in the respective ipcn register to set the interrupt priority. 3. write the desired settings to the spixcon1 and spixcon2 registers with msten (spixcon1<5>) = 0 . 4. clear the smp bit. 5. if the cke bit is set, then the ssen bit (spixcon1<7>) must be set to enable the ssx pin. 6. clear the spirov bit (spixstat<6>). 7. enable spi operation by setting the spien bit (spixstat<15>). note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note: in this section, the spi modules are referred to together as spix, or separately as spi1 and spi2. special function reg- isters will follow a similar notation. for example, spixcon refers to the control register for the spi1 or spi2 module. note: both the transmit buffer (spixtxb) and the receive buffer (spixrxb) are mapped to the same register address, spixbuf. do not perform read-modify-write opera- tions (such as bit-oriented instructions) on the spixbuf register.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 162 ? 2007 microchip technology inc. the spi module generates an interrupt indicating com- pletion of a byte or word transfer, as well as a separate interrupt for all spi error conditions. figure 15-1: spi modu le block diagram note: both spi1 and spi2 can trigger a dma data transfer. if spi1 or spi2 is selected as the dma irq source, a dma transfer occurs when the spi1if or spi2if bit gets set as a result of an spi1 or spi2 byte or word transfer. internal data bus sdix sdox ssx sckx spixsr bit 0 shift control edge select f cy primary 1:1/4/16/64 enable prescaler sync spixbuf control transfer transfer write spixbuf read spixbuf 16 spixcon1<1:0> spixcon1<4:2> master clock clock control secondary prescaler 1:1 to 1:8 spixrxb spixtxb
? 2007 microchip technology inc. ds70286a-page 163 dspic33fjxxxgpx06/x08/x10 figure 15-2: spi mast er/slave connection figure 15-3: spi master, fram e master connection diagram figure 15-4: spi master, f rame slave connection diagram serial receive buffer (spixrxb) lsb msb sdix sdox processor 2 (spi slave) sckx ssx (1) serial transmit buffer (spixtxb) serial receive buffer (spixrxb) shift register (spixsr) msb lsb sdox sdix processor 1 (spi master) serial clock (ssen (spixcon1<7>) = 1 and msten (spixcon1<5>) = 0 ) note 1: using the ssx pin in slave mode of operation is optional. 2: user must write transmit data to/read received data from spixbuf. the spixtxb and spixrxb registers are memory mapped to spixbuf. sckx serial transmit buffer (spixtxb) (msten (spixcon1<5>) = 1 ) spi buffer (spixbuf) (2) spi buffer (spixbuf) (2) shift register (spixsr) sdox sdix dspic33f serial clock ssx sckx frame sync pulse sdix sdox processor 2 ssx sckx sdox sdix dspic33f serial clock ssx sckx frame sync pulse sdix sdox processor 2 ssx sckx
dspic33fjxxxgpx06/x08/x10 ds70286a-page 164 ? 2007 microchip technology inc. figure 15-5: spi slave, fram e master connection diagram figure 15-6: spi slave, fram e slave connection diagram equation 15-1: relationship between device and spi clock speed table 15-1: sample sckx frequencies f cy = 40 mhz secondary prescaler settings 1:1 2:1 4:1 6:1 8:1 primary prescaler settings 1:1 invalid invalid 10000 6666.67 5000 4:1 10000 5000 2500 1666.67 1250 16:1 2500 1250 625 416.67 312.50 64:1 625 312.5 156.25 104.17 78.125 f cy = 5 mhz primary prescaler settings 1:1 5000 2500 1250 833 625 4:1 1250 625 313 208 156 16:1 313 156 78 52 39 64:17839201310 note: sckx frequencies shown in khz. sdox sdix dspic33f serial clock ssx sckx frame sync pulse sdix sdox processor 2 ssx sckx sdox sdix dspic33f serial clock ssx sckx frame sync pulse sdix sdox processor 2 ssx sckx primary prescaler * secondary prescaler f cy f sck =
? 2007 microchip technology inc. ds70286a-page 165 dspic33fjxxxgpx06/x08/x10 register 15-1: spixstat: spix status and control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 spien ? spisidl ? ? ? ? ? bit 15 bit 8 u-0 r/c-0 u-0 u-0 u-0 u-0 r-0 r-0 ? spirov ? ? ? ? spitbf spirbf bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 spien: spix enable bit 1 = enables module and configures sckx, sdox, sdix and ssx as serial port pins 0 = disables module bit 14 unimplemented: read as ? 0 ? bit 13 spisidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 spirov: receive overflow flag bit 1 = a new byte/word is completely received and discarded. the user software has not read the previous data in the spixbuf register. 0 = no overflow has occurred bit 5-2 unimplemented: read as ? 0 ? bit 1 spitbf: spix transmit buffer full status bit 1 = transmit not yet started, spixtxb is full 0 = transmit started, spixtxb is empty automatically set in hardware when cpu writes spixbuf location, loading spixtxb. automatically cleared in hardware when spix module transfers data from spixtxb to spixsr. bit 0 spirbf: spix receive buffer full status bit 1 = receive complete, spixrxb is full 0 = receive is not complete, spixrxb is empty automatically set in hardware when spix transfers data from spixsr to spixrxb. automatically cleared in hardware when core reads spixbuf location, reading spixrxb.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 166 ? 2007 microchip technology inc. register 15-2: spi x con1: spix control register 1 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? dissck dissdo mode16 smp cke (1) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ssen ckp msten spre<2:0> ppre<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12 dissck: disable sckx pin bit (spi master modes only) 1 = internal spi clock is disabled, pin functions as i/o 0 = internal spi clock is enabled bit 11 dissdo: disable sdox pin bit 1 = sdox pin is not used by module; pin functions as i/o 0 = sdox pin is controlled by the module bit 10 mode16: word/byte communication select bit 1 = communication is word-wide (16 bits) 0 = communication is byte-wide (8 bits) bit 9 smp: spix data input sample phase bit master mode: 1 = input data sampled at end of data output time 0 = input data sampled at middle of data output time slave mode: smp must be cleared when spix is used in slave mode. bit 8 cke: spix clock edge select bit (1) 1 = serial output data changes on transition from active clock state to idle clock state (see bit 6) 0 = serial output data changes on transition from idle clock state to active clock state (see bit 6) bit 7 ssen: slave select enable bit (slave mode) 1 = ssx pin used for slave mode 0 = ssx pin not used by module. pin controlled by port function. bit 6 ckp: clock polarity select bit 1 = idle state for clock is a high level; active state is a low level 0 = idle state for clock is a low level; active state is a high level bit 5 msten: master mode enable bit 1 = master mode 0 = slave mode bit 4-2 spre<2:0>: secondary prescale bits (master mode) 111 = secondary prescale 1:1 110 = secondary prescale 2:1 ? ? ? 000 = secondary prescale 8:1 bit 1-0 ppre<1:0>: primary prescale bits (master mode) 11 = primary prescale 1:1 10 = primary prescale 4:1 01 = primary prescale 16:1 00 = primary prescale 64:1 note 1: the cke bit is not used in the framed spi modes. the user should program this bit to ? 0 ? for the framed spi modes (frmen = 1 ).
? 2007 microchip technology inc. ds70286a-page 167 dspic33fjxxxgpx06/x08/x10 register 15-3: spixcon2: spix control register 2 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 frmen spifsd frmpol ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 ? ? ? ? ? ? frmdly ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 frmen : framed spix support bit 1 = framed spix support enabled (ssx pin used as frame sync pulse input/output) 0 = framed spix support disabled bit 14 spifsd : frame sync pulse direction control bit 1 = frame sync pulse input (slave) 0 = frame sync pulse output (master) bit 13 frmpol : frame sync pulse polarity bit 1 = frame sync pulse is active-high 0 = frame sync pulse is active-low bit 12-2 unimplemented: read as ? 0 ? bit 1 frmdly : frame sync pulse edge select bit 1 = frame sync pulse coincides with first bit clock 0 = frame sync pulse precedes first bit clock bit 0 unimplemented: this bit must not be set to ? 1 ? by the user application.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 168 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 169 dspic33fjxxxgpx06/x08/x10 16.0 inter-integrated circuit (i 2 c) the inter-integrated circuit (i 2 c) module provides complete hardware support for both slave and multi- master modes of the i 2 c serial communication standard, with a 16-bit interface. the dspic33fjxxxgpx06/x08/x10 devices have up to two i 2 c interface modules, denoted as i2c1 and i2c2. each i 2 c module has a 2-pin interface: the sclx pin is clock and the sdax pin is data. each i 2 c module ?x? (x = 1 or 2) offers the following key features: ?i 2 c interface supporting both master and slave operation. ?i 2 c slave mode supports 7 and 10-bit address. ?i 2 c master mode supports 7 and 10-bit address. ?i 2 c port allows bidirectional transfers between master and slaves. ? serial clock synchronization for i 2 c port can be used as a handshake mechanism to suspend and resume serial transfer (sclrel control). ?i 2 c supports multi-master operation; detects bus collision and will arbitrate accordingly. 16.1 operating modes the hardware fully implements all the master and slave functions of the i 2 c standard and fast mode specifications, as well as 7 and 10-bit addressing. the i 2 c module can operate either as a slave or a master on an i 2 c bus. the following types of i 2 c operation are supported: ?i 2 c slave operation with 7-bit address ?i 2 c slave operation with 10-bit address ?i 2 c master operation with 7 or 10-bit address for details about the communication sequence in each of these modes, please refer to the ? dspic33f family reference manual? . 16.2 i 2 c registers i2cxcon and i2cxstat are control and status registers, respectively. the i2cxcon register is readable and writable. the lower six bits of i2cxstat are read-only. the remaining bits of the i2cstat are read/write. i2cxrsr is the shift register used for shifting data, whereas i2cxrcv is the buffer register to which data bytes are written, or from which data bytes are read. i2cxrcv is the receive buffer. i2cxtrn is the transmit register to which bytes are written during a transmit operation. the i2cxadd register holds the slave address. a status bit, add10, indicates 10-bit address mode. the i2cxbrg acts as the baud rate generator (brg) reload value. in receive operations, i2cxrsr and i2cxrcv together form a double-buffered receiver. when i2cxrsr receives a complete byte, it is transferred to i2cxrcv and an interrupt pulse is generated. 16.3 i 2 c interrupts the i 2 c module generates two interrupt flags, mi2cxif (i 2 c master events interrupt flag) and si2cxif (i 2 c slave events interrupt flag). a separate interrupt is generated for all i 2 c error conditions. 16.4 baud rate generator in i 2 c master mode, the reload value for the brg is located in the i2cxbrg register. when the brg is loaded with this value, the brg counts down to ? 0 ? and stops until another reload has taken place. if clock arbi- tration is taking place, for instance, the brg is reloaded when the sclx pin is sampled high. as per the i 2 c standard, f scl may be 100 khz or 400 khz. however, the user can specify any baud rate up to 1 mhz. i2cxbrg values of ? 0 ? or ? 1 ? are illegal. equation 16-1: serial clock rate note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. i2cxbrg = f cy f cy f scl 10,000,00 ? 1 ? ( )
dspic33fjxxxgpx06/x08/x10 ds70286a-page 170 ? 2007 microchip technology inc. figure 16-1: i 2 c? block diagram ( x = 1 or 2) internal data bus sclx sdax shift match detect i2cxadd start and stop bit detect clock address match clock stretching i2cxtrn lsb shift clock brg down counter reload control t cy /2 start and stop bit generation acknowledge generation collision detect i2cxcon i2cxstat control logic read lsb write read i2cxbrg i2cxrsr write read write read write read write read write read i2cxmsk i2cxrcv
? 2007 microchip technology inc. ds70286a-page 171 dspic33fjxxxgpx06/x08/x10 16.5 i 2 c module addresses the i2cxadd register contains the slave mode addresses. the register is a 10-bit register. if the a10m bit (i2cxcon<10>) is ? 0 ?, the address is interpreted by the module as a 7-bit address. when an address is received, it is compared to the 7 least significant bits of the i2cxadd register. if the a10m bit is ? 1 ?, the address is assumed to be a 10-bit address. when an address is received, it will be compared with the binary value, ? 11110 a9 a8 ? (where a9 and a8 are two most significant bits of i2cxadd). if that value matches, the next address will be compared with the least significant 8 bits of i2cxadd, as specified in the 10-bit addressing protocol. table 16-1: 7-bit i 2 c? slave addresses supported by dspic33fjxxxgpx06/x08/ x10 16.6 slave address masking the i2cxmsk register (register 16-3) designates address bit positions as ?don?t care? for both 7-bit and 10-bit address modes. setting a particular bit location (= 1 ) in the i2cxmsk register, causes the slave module to respond, whether the corresponding address bit value is a ? 0 ? or ? 1 ?. for example, when i2cxmsk is set to ? 00100000 ?, the slave module will detect both addresses, ? 0000000 ? and ? 00100000 ?. to enable address masking, the ipmi (intelligent peripheral management interface) must be disabled by clearing the ipmien bit (i2cxcon<11>). 16.7 ipmi support the control bit, ipmien, enables the module to support the intelligent peripheral management interface (ipmi). when this bit is set, the module accepts and acts upon all addresses. 16.8 general call address support the general call address can address all devices. when this address is used, all devices should, in theory, respond with an acknowledgement. the general call address is one of eight addresses reserved for specific purposes by the i 2 c protocol. it consists of all ? 0 ?s with r_w = 0 . the general call address is recognized when the general call enable (gcen) bit is set (i2cxcon<7> = 1 ). when the interrupt is serviced, the source for the interrupt can be checked by reading the contents of the i2cxrcv to determine if the address was device-specific or a general call address. 16.9 automatic clock stretch in slave modes, the module can synchronize buffer reads and write to the master device by clock stretching. 16.9.1 transmit clock stretching both 10-bit and 7-bit transmit modes implement clock stretching by asserting the sclrel bit after the falling edge of the ninth clock, if the tbf bit is cleared, indicating the buffer is empty. in slave transmit modes, clock stretching is always performed, irrespective of the stren bit. the user?s isr must set the sclrel bit before transmission is allowed to continue. by holding the sclx line low, the user has time to service the isr and load the contents of the i2cxtrn before the master device can initiate another transmit sequence. 16.9.2 receive clock stretching the stren bit in the i2cxcon register can be used to enable clock stretching in slave receive mode. when the stren bit is set, the sclx pin will be held low at the end of each data receive sequence. the user?s isr must set the sclrel bit before recep- tion is allowed to continue. by holding the sclx line low, the user has time to service the isr and read the contents of the i2cxrcv before the master device can initiate another receive sequence. this will prevent buffer overruns from occurring. 16.10 software controlled clock stretching (stren = 1 ) when the stren bit is ? 1 ?, the sclrel bit may be cleared by software to allow software to control the clock stretching. if the stren bit is ? 0 ?, a software write to the sclrel bit will be disregarded and have no effect on the sclrel bit. 0x00 general call address or start byte 0x01-0x03 reserved 0x04-0x07 hs mode master codes 0x08-0x77 valid 7-bit addresses 0x78-0x7b valid 10-bit addresses (lower 7 bits) 0x7c-0x7f reserved
dspic33fjxxxgpx06/x08/x10 ds70286a-page 172 ? 2007 microchip technology inc. 16.11 slope control the i 2 c standard requires slope control on the sdax and sclx signals for fast mode (400 khz). the control bit, disslw, enables the user to disable slew rate con- trol if desired. it is necessary to disable the slew rate control for 1 mhz mode. 16.12 clock arbitration clock arbitration occurs when the master deasserts the sclx pin (sclx allowed to float high) during any receive, transmit or restart/stop condition. when the sclx pin is allowed to float high, the baud rate gen- erator (brg) is suspended from counting until the sclx pin is actually sampled high. when the sclx pin is sampled high, the baud rate generator is reloaded with the contents of i2cxbrg and begins counting. this ensures that the sclx high time will always be at least one brg rollover count in the event that the clock is held low by an external device. 16.13 multi-master communication, bus collision and bus arbitration multi-master mode support is achieved by bus arbitration. when the master outputs address/data bits onto the sdax pin, arbitration takes place when the master outputs a ? 1 ? on sdax by letting sdax float high while another master asserts a ? 0 ?. when the sclx pin floats high, data should be stable. if the expected data on sdax is a ? 1 ? and the data sampled on the sdax pin = 0 , then a bus collision has taken place. the master will set the i 2 c master events interrupt flag and reset the master portion of the i 2 c port to its idle state.
? 2007 microchip technology inc. ds70286a-page 173 dspic33fjxxxgpx06/x08/x10 register 16-1: i2cxcon: i2cx control register r/w-0 u-0 r/w-0 r/w-1 hc r/w-0 r/w-0 r/w-0 r/w-0 i2cen ? i2csidl sclrel ipmien a10m disslw smen bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 hc r/w-0 hc r/w-0 hc r/w-0 hc r/w-0 hc gcen stren ackdt acken rcen pen rsen sen bit 7 bit 0 legend: u = unimplemented bit, read as ?0? r = readable bit w = writable bit hs = set in hardware hc = cleared in hardware -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 i2cen: i2cx enable bit 1 = enables the i2cx module and configures the sdax and sclx pins as serial port pins 0 = disables the i2cx module. all i 2 c pins are controlled by port functions. bit 14 unimplemented: read as ? 0 ? bit 13 i2csidl: stop in idle mode bit 1 = discontinue module operation when device enters an idle mode 0 = continue module operation in idle mode bit 12 sclrel: sclx release control bit (when operating as i 2 c slave) 1 = release sclx clock 0 = hold sclx clock low (clock stretch) if stren = 1 : bit is r/w (i.e., software may write ? 0 ? to initiate stretch and write ? 1 ? to release clock). hardware clear at beginning of slave transmission. hardware clear at end of slave reception. if stren = 0 : bit is r/s (i.e., software may only write ? 1 ? to release clock). hardware clear at beginning of slave transmission. bit 11 ipmien: intelligent peripheral management interface (ipmi) enable bit 1 = ipmi mode is enabled; all addresses acknowledged 0 = ipmi mode disabled bit 10 a10m: 10-bit slave address bit 1 = i2cxadd is a 10-bit slave address 0 = i2cxadd is a 7-bit slave address bit 9 disslw: disable slew rate control bit 1 = slew rate control disabled 0 = slew rate control enabled bit 8 smen: smbus input levels bit 1 = enable i/o pin thresholds compliant with smbus specification 0 = disable smbus input thresholds bit 7 gcen: general call enable bit (when operating as i 2 c slave) 1 = enable interrupt when a general call address is received in the i2cxrsr (module is enabled for reception) 0 = general call address disabled bit 6 stren: sclx clock stretch enable bit (when operating as i 2 c slave) used in conjunction with sclrel bit. 1 = enable software or receive clock stretching 0 = disable software or receive clock stretching
dspic33fjxxxgpx06/x08/x10 ds70286a-page 174 ? 2007 microchip technology inc. bit 5 ackdt: acknowledge data bit (when operating as i 2 c master, applicable during master receive) value that will be transmitted when the software initiates an acknowledge sequence. 1 = send nack during acknowledge 0 = send ack during acknowledge bit 4 acken: acknowledge sequence enable bit (when operating as i 2 c master, applicable during master receive) 1 = initiate acknowledge sequence on sdax and sclx pins and transmit ackdt data bit. hardware clear at end of master acknowledge sequence. 0 = acknowledge sequence not in progress bit 3 rcen: receive enable bit (when operating as i 2 c master) 1 = enables receive mode for i 2 c. hardware clear at end of eighth bit of master receive data byte. 0 = receive sequence not in progress bit 2 pen: stop condition enable bit (when operating as i 2 c master) 1 = initiate stop condition on sdax and sclx pins. hardware clear at end of master stop sequence. 0 = stop condition not in progress bit 1 rsen: repeated start condition enable bit (when operating as i 2 c master) 1 = initiate repeated start condition on sdax and sclx pins. hardware clear at end of master repeated start sequence. 0 = repeated start condition not in progress bit 0 sen: start condition enable bit (when operating as i 2 c master) 1 = initiate start condition on sdax and sclx pins. hardware clear at end of master start sequence. 0 = start condition not in progress register 16-1: i2cxcon: i2cx control register (continued)
? 2007 microchip technology inc. ds70286a-page 175 dspic33fjxxxgpx06/x08/x10 register 16-2: i2cxstat: i2cx status register r-0 hsc r-0 hsc u-0 u-0 u-0 r/c-0 hs r-0 hsc r-0 hsc ackstat trstat ? ? ? bcl gcstat add10 bit 15 bit 8 r/c-0 hs r/c-0 hs r-0 hsc r/c-0 hsc r/c-0 hsc r-0 hsc r-0 hsc r-0 hsc iwcol i2cov d_a p s r_w rbf tbf bit 7 bit 0 legend: u = unimplemented bit, read as ?0? r = readable bit w = writable bit hs = set in hardware hsc = hardware set/cleared -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ackstat: acknowledge status bit (when operating as i 2 c master, applicable to master transmit operation) 1 = nack received from slave 0 = ack received from slave hardware set or clear at end of slave acknowledge. bit 14 trstat: transmit status bit (when operating as i 2 c master, applicable to master transmit operation) 1 = master transmit is in progress (8 bits + ack) 0 = master transmit is not in progress hardware set at beginning of master transmission. hardware clear at end of slave acknowledge. bit 13-11 unimplemented: read as ? 0 ? bit 10 bcl: master bus collision detect bit 1 = a bus collision has been detected during a master operation 0 = no collision hardware set at detection of bus collision. bit 9 gcstat: general call status bit 1 = general call address was received 0 = general call address was not received hardware set when address matches general call address. hardware clear at stop detection. bit 8 add10: 10-bit address status bit 1 = 10-bit address was matched 0 = 10-bit address was not matched hardware set at match of 2nd byte of matched 10-bit address. hardware clear at stop detection. bit 7 iwcol: write collision detect bit 1 = an attempt to write the i2cxtrn register failed because the i 2 c module is busy 0 = no collision hardware set at occurrence of write to i2cxtrn while busy (cleared by software). bit 6 i2cov: receive overflow flag bit 1 = a byte was received while the i2cxrcv register is still holding the previous byte 0 = no overflow hardware set at attempt to transfer i2 cxrsr to i2cxrcv (cleared by software). bit 5 d_a: data/address bit (when operating as i 2 c slave) 1 = indicates that the last byte received was data 0 = indicates that the last byte received was device address hardware clear at device address match. hardware set by reception of slave byte. bit 4 p: stop bit 1 = indicates that a stop bit has been detected last 0 = stop bit was not detected last hardware set or clear when start, repeated start or stop detected.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 176 ? 2007 microchip technology inc. bit 3 s: start bit 1 = indicates that a start (or repeated start) bit has been detected last 0 = start bit was not detected last hardware set or clear when start, repeated start or stop detected. bit 2 r_w: read/write information bit (when operating as i 2 c slave) 1 = read ? indicates data transfer is output from slave 0 = write ? indicates data transfer is input to slave hardware set or clear after reception of i 2 c device address byte. bit 1 rbf: receive buffer full status bit 1 = receive complete, i2cxrcv is full 0 = receive not complete, i2cxrcv is empty hardware set when i2cxrcv is written with received byte. hardware clear when software reads i2cxrcv. bit 0 tbf: transmit buffer full status bit 1 = transmit in progress, i2cxtrn is full 0 = transmit complete, i2cxtrn is empty hardware set when software writes i2cxtrn. hardware clear at completion of data transmission. register 16-2: i2cxstat: i2cx status register (continued)
? 2007 microchip technology inc. ds70286a-page 177 dspic33fjxxxgpx06/x08/x10 register 16-3: i2cxmsk: i2cx sl ave mode address mask register u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 ? ? ? ? ? ? amsk9 amsk8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 amsk7 amsk6 amsk5 amsk4 amsk3 amsk2 amsk1 amsk0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 unimplemented: read as ? 0 ? bit 9-0 amskx: mask for address bit x select bit 1 = enable masking for bit x of incoming message address; bit match not required in this position 0 = disable masking for bit x; bit match required in this position
dspic33fjxxxgpx06/x08/x10 ds70286a-page 178 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 179 dspic33fjxxxgpx06/x08/x10 17.0 universal asynchronous receiver transmitter (uart) the universal asynchronous receiver transmitter (uart) module is one of the serial i/o modules avail- able in the dspic33fjxxxgpx06/x08/x10 device family. the uart is a full-duplex asynchronous system that can communicate with peripheral devices, such as personal computers, lin, rs-232 and rs-485 inter- faces. the module also supports a hardware flow con- trol option with the uxcts and uxrts pins and also includes an irda ? encoder and decoder. the primary features of the uart module are: ? full-duplex, 8 or 9-bit data transmission through the uxtx and uxrx pins ? even, odd or no parity options (for 8-bit data) ? one or two stop bits ? hardware flow control option with uxcts and uxrts pins ? fully integrated baud rate generator with 16-bit prescaler ? baud rates ranging from 1 mbps to 15 bps at 16 mips ? 4-deep first-in-first-out (fifo) transmit data buffer ? 4-deep fifo receive data buffer ? parity, framing and buffer overrun error detection ? support for 9-bit mode with address detect (9th bit = 1 ) ? transmit and receive interrupts ? a separate interrupt for all uart error conditions ? loopback mode for diagnostic support ? support for sync and break characters ? supports automatic baud rate detection ? irda encoder and decoder logic ? 16x baud clock output for irda support a simplified block diagram of the uart is shown in figure 17-1. the uart module consists of the key important hardware elements: ? baud rate generator ? asynchronous transmitter ? asynchronous receiver figure 17-1: uart simplified block diagram note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note 1: both uart1 and uart2 can trigger a dma data transfer. if u1tx, u1rx, u2tx or u2rx is selected as a dma irq source, a dma transfer occurs when the u1txif, u1rxif, u2txif or u2rxif bit gets set as a result of a uart1 or uart2 transmission or reception. 2: if dma transfers are required, the uart tx/rx fifo buffer must be set to a size of 1 byte/word (i.e., utxisel<1:0> = 00 and urxisel<1:0> = 00 ). uxrx hardware flow control uart receiver uart transmitter uxtx bclk baud rate generator uxrts irda ? ux ct s
dspic33fjxxxgpx06/x08/x10 ds70286a-page 180 ? 2007 microchip technology inc. 17.1 uart baud rate generator (brg) the uart module includes a dedicated 16-bit baud rate generator. the brgx register controls the period of a free-running 16-bit timer. equation 17-1 shows the formula for computation of the baud rate with brgh = 0 . equation 17-1: uart baud rate with brgh = 0 example 17-1 shows the calculation of the baud rate error for the following conditions: ?f cy = 4 mhz ? desired baud rate = 9600 the maximum baud rate (brgh = 0 ) possible is f cy /16 (for brgx = 0 ), and the minimum baud rate possible is f cy /(16 * 65536). equation 17-2 shows the formula for computation of the baud rate with brgh = 1 . equation 17-2: uart baud rate with brgh = 1 the maximum baud rate (brgh = 1 ) possible is f cy /4 (for brgx = 0 ), and the minimum baud rate possible is f cy /(4 * 65536). writing a new value to the brgx register causes the brg timer to be reset (cleared). this ensures the brg does not wait for a timer overflow before generating the new baud rate. example 17-1: baud rate erro r calculation (brgh = 0 ) note: f cy denotes the instruction cycle clock frequency (f osc /2 ). baud rate = f cy 16 ? (brgx + 1) f cy 16 ? baud rate brgx = ? 1 note: f cy denotes the instruction cycle clock frequency (f osc /2). baud rate = f cy 4 ? (brgx + 1) f cy 4 ? baud rate brgx = ? 1 desired baud rate = f cy /(16 (brgx + 1)) solving for brgx value: brgx = ((f cy /desired baud rate)/16) ? 1 brgx = ((4000000/9600)/16) ? 1 brgx = 25 calculated baud rate = 4000000/(16 (25 + 1)) = 9615 error = (calculated baud ra te ? desired baud rate) desired baud rate = (9615 ? 9600)/9600 =0.16%
? 2007 microchip technology inc. ds70286a-page 181 dspic33fjxxxgpx06/x08/x10 17.2 transmitting in 8-bit data mode 1. set up the uart: a) write appropriate values for data, parity and stop bits. b) write appropriate baud rate value to the brgx register. c) set up transmit and receive interrupt enable and priority bits. 2. enable the uart. 3. set the utxen bit (causes a transmit interrupt). 4. write data byte to lower byte of uxtxreg word. the value will be immediately transferred to the transmit shift register (tsr) and the serial bit stream will start shifting out with the next rising edge of the baud clock. 5. alternately, the data byte may be transferred while utxen = 0 , and then the user may set utxen. this will cause the serial bit stream to begin immediately because the baud clock will start from a cleared state. 6. a transmit interrupt will be generated as per interrupt control bits, utxisel<1:0>. 17.3 transmitting in 9-bit data mode 1. set up the uart (as described in section 17.2 ?transmitting in 8-bit data mode? ). 2. enable the uart. 3. set the utxen bit (causes a transmit interrupt). 4. write uxtxreg as a 16-bit value only. 5. a word write to uxtxreg triggers the transfer of the 9-bit data to the tsr. serial bit stream will start shifting out with the first rising edge of the baud clock. 6. a transmit interrupt will be generated as per the setting of control bits, utxisel<1:0>. 17.4 break and sync transmit sequence the following sequence will send a message frame header made up of a break, followed by an auto-baud sync byte. 1. configure the uart for the desired mode. 2. set utxen and utxbrk ? sets up the break character. 3. load the uxtxreg register with a dummy character to initiate transmission (value is ignored). 4. write 0x55 to uxtxreg ? loads sync character into the transmit fifo. 5. after the break has been sent, the utxbrk bit is reset by hardware. the sync character now transmits. 17.5 receiving in 8-bit or 9-bit data mode 1. set up the uart (as described in section 17.2 ?transmitting in 8-bit data mode? ). 2. enable the uart. 3. a receive interrupt will be generated when one or more data characters have been received as per interrupt control bits, urxisel<1:0>. 4. read the oerr bit to determine if an overrun error has occurred. the oerr bit must be reset in software. 5. read uxrxreg. the act of reading the uxrxreg character will move the next character to the top of the receive fifo, including a new set of perr and ferr values. 17.6 flow control using uxcts and uxrts pins uartx clear to send (uxcts ) and request to send (uxrts ) are the two hardware controlled active-low pins that are associated with the uart module. these two pins allow the uart to operate in simplex and flow control modes. they are implemented to control the transmission and the reception between the data terminal equipment (dte). the uen<1:0> bits in the uxmode register configures these pins. 17.7 infrared support the uart module provides two types of infrared uart support: ? irda clock output to support external irda encoder and decoder device (legacy module support) ? full implementation of the irda encoder and decoder. 17.7.1 external irda support ? irda clock output to support external irda encoder and decoder devices, the bclk pin (same as the uxrts pin) can be configured to generate the 16x baud clock. with uen<1:0> = 11 , the bclk pin will output the 16x baud clock if the uart module is enabled; it can be used to support the irda codec chip. 17.7.2 built-in irda encoder and decoder the uart has full implementation of the irda encoder and decoder as part of the uart module. the built-in irda encoder and decoder functionality is enabled using the iren bit (uxmode<12>). when enabled (iren = 1 ), the receive pin (uxrx) acts as the input from the infrared receiver. the transmit pin (uxtx) acts as the output to the infrared transmitter.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 182 ? 2007 microchip technology inc. register 17-1: uxmode: uart x mode register r/w-0 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 (2) r/w-0 (2) uarten ? usidl iren (1) rtsmd ?uen<1:0> bit 15 bit 8 r/w-0 hc r/w-0 r/w-0 hc r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 wake lpback abaud urxinv brgh pdsel<1:0> stsel bit 7 bit 0 legend: hc = hardware cleared r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 uarten: uartx enable bit 1 = uartx is enabled; all uartx pins are controlled by uartx as defined by uen<1:0> 0 = uartx is disabled; all uartx pins are controlled by port latches; uartx power consumption minimal bit 14 unimplemented: read as ? 0 ? bit 13 usidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode. 0 = continue module operation in idle mode bit 12 iren: irda encoder and decoder enable bit (1) 1 =irda ? encoder and decoder enabled 0 = irda encoder and decoder disabled bit 11 rtsmd: mode selection for uxrts pin bit 1 =uxrts pin in simplex mode 0 =uxrts pin in flow control mode bit 10 unimplemented: read as ? 0 ? bit 9-8 uen<1:0>: uartx enable bits 11 =uxtx, uxrx and bclk pins are enabled and used; uxcts pin controlled by port latches 10 =uxtx, uxrx, uxcts and uxrts pins are enabled and used 01 =uxtx, uxrx and uxrts pins are enabled and used; uxcts pin controlled by port latches 00 =uxtx and uxrx pins are enabled and used; uxcts and uxrts /bclk pins controlled by port latches bit 7 wake: wake-up on start bit detect during sleep mode enable bit 1 = uartx will continue to sample the uxrx pin; interrupt generated on falling edge; bit cleared in hardware on following rising edge 0 = no wake-up enabled bit 6 lpback: uartx loopback mode select bit 1 = enable loopback mode 0 = loopback mode is disabled bit 5 abaud: auto-baud enable bit 1 = enable baud rate measurement on the next character ? requires reception of a sync field (55h) before other data; cleared in hardware upon completion 0 = baud rate measurement disabled or completed bit 4 urxinv: receive polarity inversion bit 1 = uxrx idle state is ? 0 ? 0 = uxrx idle state is ? 1 ? note 1: this feature is only available for the 16x brg mode (brgh = 0 ). 2: bit availability depends on pin availability.
? 2007 microchip technology inc. ds70286a-page 183 dspic33fjxxxgpx06/x08/x10 bit 3 brgh: high baud rate enable bit 1 = brg generates 4 clocks per bit period (4x baud clock, high-speed mode) 0 = brg generates 16 clocks per bit period (16x baud clock, standard mode) bit 2-1 pdsel<1:0>: parity and data selection bits 11 = 9-bit data, no parity 10 = 8-bit data, odd parity 01 = 8-bit data, even parity 00 = 8-bit data, no parity bit 0 stsel: stop bit selection bit 1 = two stop bits 0 = one stop bit register 17-1: uxmode: uart x mode register (continued) note 1: this feature is only available for the 16x brg mode (brgh = 0 ). 2: bit availability depends on pin availability.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 184 ? 2007 microchip technology inc. register 17-2: u x sta: uart x status and control register r/w-0 r/w-0 r/w-0 u-0 r/w-0 hc r/w-0 r-0 r-1 utxisel1 utxinv (1) utxisel0 ? utxbrk utxen utxbf trmt bit 15 bit 8 r/w-0 r/w-0 r/w-0 r-1 r-0 r-0 r/c-0 r-0 urxisel<1:0> adden ridle perr ferr oerr urxda bit 7 bit 0 legend: hc = hardware cleared r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15,13 utxisel<1:0>: transmission interrupt mode selection bits 11 =reserved; do not use 10 =interrupt when a character is transferred to the transmit shift register, and as a result, the transmit buffer becomes empty 01 =interrupt when the last character is shifted out of the transmit shift register; all transmit operations are completed 00 =interrupt when a character is transferred to the transmit shift register (this implies there is at least one character open in the transmit buffer) bit 14 utxinv: irda encoder transmit polarity inversion bit (1) 1 =irda ? encoded, uxtx idle state is ? 1 ? 0 = irda encoded, uxtx idle state is ? 0 ? bit 12 unimplemented: read as ? 0 ? bit 11 utxbrk: transmit break bit 1 = send sync break on next transmission ? start bit, followed by twelve ? 0 ? bits, followed by stop bit; cleared by hardware upon completion 0 = sync break transmission disabled or completed bit 10 utxen: transmit enable bit 1 = transmit enabled, uxtx pin controlled by uartx 0 = transmit disabled, any pending transmission is aborted and buffer is reset. uxtx pin controlled by port. bit 9 utxbf: transmit buffer full status bit (read-only) 1 = transmit buffer is full 0 = transmit buffer is not full, at least one more character can be written bit 8 trmt: transmit shift register empty bit (read-only) 1 = transmit shift register is empty and transmit buf fer is empty (the last transmission has completed) 0 = transmit shift register is not empty, a transmission is in progress or queued bit 7-6 urxisel<1:0>: receive interrupt mode selection bits 11 =interrupt is set on uxrsr transfer making the receive buffer full (i.e., has 4 data characters) 10 =interrupt is set on uxrsr transfer making the receive buffer 3/4 full (i.e., has 3 data characters) 0x =interrupt is set when any character is received and transferred from the uxrsr to the receive buffer. receive buffer has one or more characters. bit 5 adden: address character detect bit (bit 8 of received data = 1 ) 1 = address detect mode enabled. if 9-bit mode is not selected, this does not take effect. 0 = address detect mode disabled note 1: value of bit only affects the transmit properties of the module when the irda encoder is enabled (iren = 1 ).
? 2007 microchip technology inc. ds70286a-page 185 dspic33fjxxxgpx06/x08/x10 bit 4 ridle: receiver idle bit (read-only) 1 = receiver is idle 0 = receiver is active bit 3 perr: parity error status bit (read-only) 1 = parity error has been detected for the current character (character at the top of the receive fifo) 0 = parity error has not been detected bit 2 ferr: framing error status bit (read-only) 1 = framing error has been detected for the current character (character at the top of the receive fifo) 0 = framing error has not been detected bit 1 oerr: receive buffer overrun error status bit (read/clear only) 1 = receive buffer has overflowed 0 = receive buffer has not overflowed. clearing a previously set oerr bit ( 1 0 transition) will reset the receiver buffer and the uxrsr to the empty state. bit 0 urxda: receive buffer data available bit (read-only) 1 = receive buffer has data, at least one more character can be read 0 = receive buffer is empty register 17-2: u x sta: uart x status and control register (continued) note 1: value of bit only affects the transmit properties of the module when the irda encoder is enabled (iren = 1 ).
dspic33fjxxxgpx06/x08/x10 ds70286a-page 186 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 187 dspic33fjxxxgpx06/x08/x10 18.0 enhanced can (ecan?) module 18.1 overview the enhanced controller area network (ecan) mod- ule is a serial interface, useful for communicating with other can modules or microcontroller devices. this interface/protocol was designed to allow communica- tions within noisy environments. the dspic33fjxxxgpx06/x08/x10 devices contain up to two ecan modules. the can module is a communication controller imple- menting the can 2.0 a/b protocol, as defined in the bosch specification. the module will support can 1.2, can 2.0a, can 2.0b passive and can 2.0b active versions of the protocol. the module implementation is a full can system. the can specification is not covered within this data sheet. the reader may refer to the bosch can specification for further details. the module features are as follows: ? implementation of the can protocol, can 1.2, can 2.0a and can 2.0b ? standard and extended data frames ? 0-8 bytes data length ? programmable bit rate up to 1 mbit/sec ? automatic response to remote transmission requests ? up to 8 transmit buffers with application specified prioritization and abort capability (each buffer may contain up to 8 bytes of data) ? up to 32 receive buffers (each buffer may contain up to 8 bytes of data) ? up to 16 full (standard/extended identifier) acceptance filters ? 3 full acceptance filter masks ? devicenet? addressing support ? programmable wake-up functionality with integrated low-pass filter ? programmable loopback mode supports self-test operation ? signaling via interrupt capabilities for all can receiver and transmitter error states ? programmable clock source ? programmable link to input capture module (ic2 for both can1 and can2) for time-stamping and network synchronization ? low-power sleep and idle mode the can bus module consists of a protocol engine and message buffering/control. the can protocol engine handles all functions for receiving and transmitting messages on the can bus. messages are transmitted by first loading the appropriate data registers. status and errors can be checked by reading the appropriate registers. any message detected on the can bus is checked for errors and then matched against filters to see if it should be received and stored in one of the receive registers. 18.2 frame types the can module transmits various types of frames which include data messages, or remote transmission requests initiated by the user, as other frames that are automatically generated for control purposes. the following frame types are supported: ? standard data frame: a standard data frame is generated by a node when the node wishes to transmit data. it includes an 11-bit standard identifier (sid), but not an 18-bit extended identifier (eid). ? extended data frame: an extended data frame is similar to a standard data frame, but includes an extended identifier as well. ? remote frame: it is possible for a destination node to request the data from the source. for this purpose, the destination node sends a remote frame with an identifier that matches the identifier of the required data frame. the appropriate data source node will then send a data frame as a response to this remote request. ? error frame: an error frame is generated by any node that detects a bus error. an error frame consists of two fields: an error flag field and an error delimiter field. ? overload frame: an overload frame can be generated by a node as a result of two conditions. first, the node detects a dominant bit during interframe space which is an illegal condition. second, due to internal condi- tions, the node is not yet able to start reception of the next message. a node may generate a maxi- mum of 2 sequential overload frames to delay the start of the next message. ? interframe space: interframe space separates a proceeding frame (of whatever type) from a following data or remote frame. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 188 ? 2007 microchip technology inc. figure 18-1: ecan? mo dule block diagram message assembly can protocol engine citx (1) buffer cirx (1) rxf14 filter rxf13 filter rxf12 filter rxf11 filter rxf10 filter rxf9 filter rxf8 filter rxf7 filter rxf6 filter rxf5 filter rxf4 filter rxf3 filter rxf2 filter rxf1 filter rxf0 filter transmit byte sequencer rxm1 mask rxm0 mask control configuration logic cpu bus interrupts trb0 tx/rx buffer control register dma controller rxf15 filter rxm2 mask trb7 tx/rx buffer control register trb6 tx/rx buffer control register trb5 tx/rx buffer control register trb4 tx/rx buffer control register trb3 tx/rx buffer control register trb2 tx/rx buffer control register trb1 tx/rx buffer control register note 1: i = 1 or 2 refers to a particular ecan module (ecan1 or ecan2).
? 2007 microchip technology inc. ds70286a-page 189 dspic33fjxxxgpx06/x08/x10 18.3 modes of operation the can module can operate in one of several operation modes selected by the user. these modes include: ? initialization mode ? disable mode ? normal operation mode ? listen only mode ? listen all messages mode ? loopback mode modes are requested by setting the reqop<2:0> bits (cictrl1<10:8>). entry into a mode is acknowledged by monitoring the opmode<2:0> bits (cictrl1<7:5>). the module will not change the mode and the opmode bits until a change in mode is acceptable, generally during bus idle time, which is defined as at least 11 consecutive recessive bits. 18.3.1 initialization mode in the initialization mode, the module will not transmit or receive. the error counters are cleared and the inter- rupt flags remain unchanged. the programmer will have access to configuration registers that are access restricted in other modes. the module will protect the user from accidentally violating the can protocol through programming errors. all registers which control the configuration of the module can not be modified while the module is on-line. the can module will not be allowed to enter the configuration mode while a transmission is taking place. the configuration mode serves as a lock to protect the following registers: ? all module control registers ? baud rate and interrupt configuration registers ? bus timing registers ? identifier acceptance filter registers ? identifier acceptance mask registers 18.3.2 disable mode in disable mode, the module will not transmit or receive. the module has the ability to set the wakif bit due to bus activity, however, any pending interrupts will remain and the error counters will retain their value. if the reqop<2:0> bits (cictrl1<10:8>) = 001 , the module will enter the module disable mode. if the module is active, the module will wait for 11 recessive bits on the can bus, detect that condition as an idle bus, then accept the module disable command. when the opmode<2:0> bits (cictrl1<7:5>) = 001 , that indi- cates whether the module successfully went into module disable mode. the i/o pins will revert to normal i/o function when the module is in the module disable mode. the module can be programmed to apply a low-pass filter function to the cirx input line while the module or the cpu is in sleep mode. the wakfil bit (cicfg2<14>) enables or disables the filter. 18.3.3 normal operation mode normal operation mode is selected when reqop<2:0> = 000 . in this mode, the module is activated and the i/o pins will assume the can bus functions. the module will transmit and receive can bus messages via the citx and cirx pins. 18.3.4 listen only mode if the listen only mode is activated, the module on the can bus is passive. the transmitter buffers revert to the port i/o function. the receive pins remain inputs. for the receiver, no error flags or acknowledge signals are sent. the error counters are deactivated in this state. the listen only mode can be used for detecting the baud rate on the can bus. to use this, it is neces- sary that there are at least two further nodes that communicate with each other. 18.3.5 listen all messages mode the module can be set to ignore all errors and receive any message. the listen all messages mode is acti- vated by setting reqop<2:0> = ? 111 ?. in this mode, the data which is in the message assembly buffer, until the time an error occurred, is copied in the receive buffer and can be read via the cpu interface. 18.3.6 loopback mode if the loopback mode is activated, the module will con- nect the internal transmit signal to the internal receive signal at the module boundary. the transmit and receive pins revert to their port i/o function. 18.4 message reception 18.4.1 receive buffers the can bus module has up to 32 receive buffers, located in dma ram. the first 8 buffers need to be configured as receive buffers by clearing the corresponding tx/rx buffer selection (txenn) bit in a citrmncon register. the overall size of the can buffer area in dma ram is selectable by the user and is defined by the dmabs<2:0> bits (cifctrl<15:13>). the first 16 buffers can be assigned to receive filters, while the rest can be used only as a fifo buffer. note: typically, if the can module is allowed to transmit in a particular mode of operation and a transmission is requested immedi- ately after the can module has been placed in that mode of operation, the mod- ule waits for 11 consecutive recessive bits on the bus before starting transmission. if the user switches to disable mode within this 11-bit period, then this transmission is aborted and the corresponding txabt bit is set and txreq bit is cleared.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 190 ? 2007 microchip technology inc. an additional buffer is always committed to monitoring the bus for incoming messages. this buffer is called the message assembly buffer (mab). all messages are assembled by the mab and are trans- ferred to the buffers only if t he acceptance filter criterion are met. when a message is received, the rbif flag (ciintf<1>) will be set. the user would then need to inspect the civec and/or cirxful1 register to deter- mine which filter and buffer caused the interrupt to get generated. the rbif bit can only be set by the module when a message is received. the bit is cleared by the user when it has completed processing the message in the buffer. if the rbie bit is set, an interrupt will be generated when a message is received. 18.4.2 fifo buffer mode the ecan module provides fifo buffer functionality if the buffer pointer for a filter has a value of ? 1111 ?. in this mode, the results of a hit on that buffer will write to the next available buffer location within the fifo. the cifctrl register defines the size of the fifo. the fsa<4:0> bits in this register define the start of the fifo buffers. the end of the fifo is defined by the dmabs<2:0> bits if dma is enabled. thus, fifo sizes up to 32 buffers are supported. 18.4.3 message acceptance filters the message acceptance filters and masks are used to determine if a message in the message assembly buffer should be loaded into either of the receive buff- ers. once a valid message has been received into the message assembly buffer (mab), the identifier fields of the message are compared to the filter values. if there is a match, that message will be loaded into the appropriate receive buffer. each filter is associated with a buffer pointer (fnbp<3:0>), which is used to link the filter to one of 16 receive buffers. the acceptance filter looks at incoming messages for the ide bit (citrbnsid<0>) to determine how to com- pare the identifiers. if the ide bit is clear, the message is a standard frame and only filters with the exide bit (cirxfnsid<3>) clear are compared. if the ide bit is set, the message is an extended frame, and only filters with the exide bit set are compared. 18.4.4 message acceptance filter masks the mask bits essentially determine which bits to apply the filter to. if any mask bit is set to a zero, then that bit will automatically be accepted regardless of the filter bit. there are three programmable acceptance filter masks associated with the receive buffers. any of these three masks can be linked to each filter by select- ing the desired mask in the fnmsk<1:0> bits in the appropriate cifmskseln register. 18.4.5 receive errors the can module will detect the following receive errors: ? cyclic redundancy check (crc) error ? bit stuffing error ? invalid message receive error these receive errors do not generate an interrupt. however, the receive error counter is incremented by one in case one of these errors occur. the rxwar bit (ciintf<9>) indicates that the receive error counter has reached the cpu warning limit of 96 and an interrupt is generated. 18.4.6 receive interrupts receive interrupts can be divided into 3 major groups, each including various conditions that generate interrupts: ? receive interrupt: a message has been successfully received and loaded into one of the receive buffers. this inter- rupt is activated immediately after receiving the end-of-frame (eof) field. reading the rxnif flag will indicate which receive buffer caused the interrupt. ? wake-up interrupt: the can module has woken up from disable mode or the device has woken up from sleep mode. ? receive error interrupts: a receive error interrupt will be indicated by the errif bit. this bit shows that an error condition occurred. the source of the error can be deter- mined by checking the bits in the can interrupt flag register, ciintf. - invalid message received: if any type of error occurred during reception of the last message, an error will be indicated by the ivrif bit. - receiver overrun: the rbovif bit (ciintf<2>) indicates that an overrun condition occurred. - receiver warning: the rxwar bit indicates that the receive error counter (rerrcnt<7:0>) has reached the warning limit of 96. - receiver error passive: the rxep bit indicates that the receive error counter has exceeded the error passive limit of 127 and the module has gone into error passive state.
? 2007 microchip technology inc. ds70286a-page 191 dspic33fjxxxgpx06/x08/x10 18.5 message transmission 18.5.1 transmit buffers the can module has up to eight transmit buffers, located in dma ram. these 8 buffers need to be con- figured as transmit buffers by setting the corresponding tx/rx buffer selection (txenn or txenm) bit in a citrmncon register. the overall size of the can buffer area in dma ram is selectable by the user and is defined by the dmabs<2:0> bits (cifctrl<15:13>). each transmit buffer occupies 16 bytes of data. eight of the bytes are the maximum 8 bytes of the transmitted message. five bytes hold the standard and extended identifiers and other message arbitration information. the last byte is unused. 18.5.2 transmit message priority transmit priority is a prioritization within each node of the pending transmittable messages. there are four levels of transmit priority. if the txnpri<1:0> bits (in citrmncon) for a particular message buffer are set to ? 11 ?, that buffer has the highest priority. if the txnpri<1:0> bits for a particular message buffer are set to ? 10 ? or ? 01 ?, that buffer has an intermediate priority. if the txnpri<1:0> bits for a particular message buffer are ? 00 ?, that buffer has the lowest pri- ority. if two or more pending messages have the same priority, the messages are transmitted in decreasing order of buffer index. 18.5.3 transmission sequence to initiate transmission of the message, the txreqn bit (in citrmncon) must be set. the can bus module resolves any timing conflicts between the setting of the txreqn bit and the start-of-frame (sof), ensuring that if the priority was changed, it is resolved correctly before the sof occurs. when txreqn is set, the txabtn, txlarbn and txerrn flag bits are automatically cleared. setting the txreqn bit simply flags a message buffer as enqueued for transmission. when the module detects an available bus, it begins transmitting the message which has been determined to have the highest priority. if the transmission completes successfully on the first attempt, the txreqn bit is cleared automatically and an interrupt is generated if txnie was set. if the message transmission fails, one of the error con- dition flags will be set and the txreqn bit will remain set, indicating that the message is still pending for transmission. if the message encountered an error condition during the transmission attempt, the txerrn bit will be set and the error condition may cause an interrupt. if the message loses arbitration during the transmission attempt, the txlarbn bit is set. no interrupt is generated to signal the loss of arbitration. 18.5.4 automatic processing of remote transmission requests if the rtrenn bit (in the citrmncon register) for a particular transmit buffer is set, the hardware automat- ically transmits the data in that buffer in response to remote transmission requests matching the filter that points to that particular buffer. the user does not need to manually initiate a transmission in this case. 18.5.5 aborting message transmission the system can also abort a message by clearing the txreq bit associated with each message buffer. set- ting the abat bit (cictrl1<12>) will request an abort of all pending messages. if the message has not yet started transmission, or if the message started but is interrupted by loss of arbitration or an error, the abort will be processed. the abort is indicated when the module sets the txabt bit and the txnif flag is not automatically set. 18.5.6 transmission errors the can module will detect the following transmission errors: ? acknowledge error ? form error ? bit error these transmission errors will not necessarily generate an interrupt but are indicated by the transmission error counter. however, each of these errors will cause the transmission error counter to be incremented by one. once the value of the error counter exceeds the value of 96, the errif (ciintf<5>) and the txwar bit (ciintf<10>) are set. once the value of the error counter exceeds the value of 96, an interrupt is generated and the txwar bit in the interrupt flag register is set.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 192 ? 2007 microchip technology inc. 18.5.7 transmit interrupts transmit interrupts can be divided into 2 major groups, each including various conditions that generate interrupts: ? transmit interrupt: at least one of the three transmit buffers is empty (not scheduled) and can be loaded to schedule a message for transmission. reading the txnif flags will indicate which transmit buffer is available and caused the interrupt. ? transmit error interrupts: a transmission error interrupt will be indicated by the errif flag. this flag shows that an error con- dition occurred. the source of the error can be determined by checking the error flags in the can interrupt flag register, ciintf. the flags in this register are related to receive and transmit errors. - transmitter warning interrupt: the txwar bit indicates that the transmit error counter has reached the cpu warning limit of 96. - transmitter error passive: the txep bit (ciintf<12>) indicates that the transmit error counter has exceeded the error passive limit of 127 and the module has gone to error passive state. - bus off: the txbo bit (ciintf<13>) indicates that the transmit error counter has exceeded 255 and the module has gone to the bus off state. 18.6 baud rate setting all nodes on any particular can bus must have the same nominal bit rate. in order to set the baud rate, the following parameters have to be initialized: ? synchronization jump width ? baud rate prescaler ? phase segments ? length determination of phase segment 2 ? sample point ? propagation segment bits 18.6.1 bit timing all controllers on the can bus must have the same baud rate and bit length. however, different controllers are not required to have the same master oscillator clock. at different clock frequencies of the individual controllers, the baud rate has to be adjusted by adjusting the number of time quanta in each segment. the nominal bit time can be thought of as being divided into separate non-overlapping time segments. these segments are shown in figure 18-2. ? synchronization segment (sync seg) ? propagation time segment (prop seg) ? phase segment 1 (phase1 seg) ? phase segment 2 (phase2 seg) the time segments and also the nominal bit time are made up of integer units of time called time quanta or t q . by definition, the nominal bit time has a minimum of 8 t q and a maximum of 25 t q . also, by definition, the minimum nominal bit time is 1 sec corresponding to a maximum bit rate of 1 mhz. figure 18-2: ecan? module bit timing note: both ecan1 and ecan2 can trigger a dma data transfer. if c1tx, c1rx, c2tx or c2rx is selected as a dma irq source, a dma transfer occurs when the c1txif, c1rxif, c2txif or c2rxif bit gets set as a result of an ecan1 or ecan2 transmission or reception. input signal sync prop segment phase segment 1 phase segment 2 sync sample point t q
? 2007 microchip technology inc. ds70286a-page 193 dspic33fjxxxgpx06/x08/x10 18.6.2 prescaler setting there is a programmable prescaler with integral values ranging from 1 to 64, in addition to a fixed divide-by-2 for clock generation. the time quantum (t q ) is a fixed unit of time derived from the oscillator period and is given by equation 18-1. equation 18-1: time quantum for clock generation 18.6.3 propagation segment this part of the bit time is used to compensate physical delay times within the network. these delay times con- sist of the signal propagation time on the bus line and the internal delay time of the nodes. the prop seg can be programmed from 1 t q to 8 t q by setting the prseg<2:0> bits (cicfg2<2:0>). 18.6.4 phase segments the phase segments are used to optimally locate the sampling of the received bit within the transmitted bit time. the sampling point is between phase1 seg and phase2 seg. these segments are lengthened or short- ened by resynchronization. the end of the phase1 seg determines the sampling point within a bit period. the segment is programmable from 1 t q to 8 t q . phase2 seg provides delay to the next transmitted data transi- tion. the segment is programmable from 1 t q to 8 t q , or it may be defined to be equal to the greater of phase1 seg or the information processing time (2 t q ). the phase1 seg is initialized by setting bits seg1ph<2:0> (cicfg2<5:3>) and phase2 seg is initialized by setting seg2ph<2:0> (cicfg2<10:8>). the following requirement must be fulfilled while setting the lengths of the phase segments: prop seg + phase1 seg phase2 seg 18.6.5 sample point the sample point is the point of time at which the bus level is read and interpreted as the value of that respec- tive bit. the location is at the end of phase1 seg. if the bit timing is slow and contains many t q , it is possible to specify multiple sampling of the bus line at the sample point. the level determined by the can bus then corre- sponds to the result from the majority decision of three values. the majority samples are taken at the sample point and twice before with a distance of t q /2. the can module allows the user to choose between sam- pling three times at the same point or once at the same point, by setting or clearing the sam bit (cicfg2<6>). typically, the sampling of the bit should take place at about 60-70% through the bit time, depending on the system parameters. 18.6.6 synchronization to compensate for phase shifts between the oscillator frequencies of the different bus stations, each can controller must be able to synchronize to the relevant signal edge of the incoming signal. when an edge in the transmitted data is detected, the logic will compare the location of the edge to the expected time (synchro- nous segment). the circuit will then adjust the values of phase1 seg and phase2 seg. there are two mechanisms used to synchronize. 18.6.6.1 hard synchronization hard synchronization is only done whenever there is a ?recessive? to ?dominant? edge during bus idle, indicat- ing the start of a message. after hard synchronization, the bit time counters are restarted with the sync seg. hard synchronization forces the edge which has caused the hard synchronization to lie within the synchronization segment of the restarted bit time. if a hard synchronization is done, there will not be a resynchronization within that bit time. 18.6.6.2 resynchronization as a result of resynchronization, phase1 seg may be lengthened or phase2 seg may be shortened. the amount of lengthening or shortening of the phase buffer segment has an upper boundary known as the synchronization jump width, and is specified by the sjw<1:0> bits (cicfg1<7:6>). the value of the syn- chronization jump width will be added to phase1 seg or subtracted from phase2 seg. the resynchronization jump width is programmable between 1 t q and 4 t q . the following requirement must be fulfilled while setting the sjw<1:0> bits: phase2 seg > synchronization jump width note: f can must not exceed 40 mhz. if cancks = 0 , then f cy must not exceed 20 mhz. t q = 2 (brp<5:0> + 1)/f can note: in the register descriptions that follow, ?i? in the register identifier denotes the specific ecan module (ecan1 or ecan2). ?n? in the register identifier denotes the buffer, filter or mask number. ?m? in the register identifier denotes the word number within a particular can data field.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 194 ? 2007 microchip technology inc. register 18-1: cictrl1: ecan control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-0 r/w-0 ? ? csidl abat cancks reqop<2:0> bit 15 bit 8 r-1 r-0 r-0 u-0 r/w-0 u-0 u-0 r/w-0 opmode<2:0> ? cancap ? ?win bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 csidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12 abat : abort all pending transmissions bit signal all transmit buffers to abort transmission. module will clear this bit when all transmissions are aborted bit 11 cancks: can master clock select bit 1 = can f can clock is f cy 0 = can f can clock is f osc bit 10-8 reqop<2:0>: request operation mode bits 000 = set normal operation mode 001 = set disable mode 010 = set loopback mode 011 = set listen only mode 100 = set configuration mode 101 = reserved ? do not use 110 = reserved ? do not use 111 = set listen all messages mode bit 7-5 opmode<2:0> : operation mode bits 000 = module is in normal operation mode 001 = module is in disable mode 010 = module is in loopback mode 011 = module is in listen only mode 100 = module is in configuration mode 101 = reserved 110 = reserved 111 = module is in listen all messages mode bit 4 unimplemented: read as ? 0 ? bit 3 cancap: can message receive timer capture event enable bit 1 = enable input capture based on can message receive 0 = disable can capture bit 2-1 unimplemented: read as ? 0 ? bit 0 win: sfr map window select bit 1 = use filter window 0 = use buffer window
? 2007 microchip technology inc. ds70286a-page 195 dspic33fjxxxgpx06/x08/x10 register 18-2: cictrl2: ecan control register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r-0 r-0 r-0 r-0 r-0 ? ? ? dncnt<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 unimplemented: read as ? 0 ? bit 4-0 dncnt<4:0> : devicenet? filter bit number bits 10010 - 11111 = invalid selection 10001 = compare up to data byte 3, bit 6 with eid<17> . . . 00001 = compare up to data byte 1, bit 7 with eid<0> 00000 = do not compare data bytes
dspic33fjxxxgpx06/x08/x10 ds70286a-page 196 ? 2007 microchip technology inc. register 18-3: civec: ecan interrupt code register u-0 u-0 u-0 r-0 r-0 r-0 r-0 r-0 ? ? ?filhit<4:0> bit 15 bit 8 u-0 r-1 r-0 r-0 r-0 r-0 r-0 r-0 ? icode<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-8 filhit<4:0> : filter hit number bits 10000-11111 = reserved 01111 = filter 15 . . . 00001 = filter 1 00000 = filter 0 bit 7 unimplemented: read as ? 0 ? bit 6-0 icode<6:0> : interrupt flag code bits 1000101 - 1111111 = reserved 1000100 = fifo almost full interrupt 1000011 = receiver overflow interrupt 1000010 = wake-up interrupt 1000001 = error interrupt 1000000 = no interrupt 0010000 - 0111111 = reserved 0001111 = rb15 buffer interrupt . . . 0001001 = rb9 buffer interrupt 0001000 = rb8 buffer interrupt 0000111 = trb7 buffer interrupt 0000110 = trb6 buffer interrupt 0000101 = trb5 buffer interrupt 0000100 = trb4 buffer interrupt 0000011 = trb3 buffer interrupt 0000010 = trb2 buffer interrupt 0000001 = trb1 buffer interrupt 0000000 = trb0 buffer interrupt
? 2007 microchip technology inc. ds70286a-page 197 dspic33fjxxxgpx06/x08/x10 register 18-4: cifctrl: ec an fifo control register r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 dmabs<2:0> ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? fsa<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 dmabs<2:0>: dma buffer size bits 111 = reserved 110 = 32 buffers in dma ram 101 = 24 buffers in dma ram 100 = 16 buffers in dma ram 011 = 12 buffers in dma ram 010 = 8 buffers in dma ram 001 = 6 buffers in dma ram 000 = 4 buffers in dma ram bit 12-5 unimplemented: read as ? 0 ? bit 4-0 fsa<4:0> : fifo area starts with buffer bits 11111 = rb31 buffer 11110 = rb30 buffer . . . 00001 = trb1 buffer 00000 = trb0 buffer
dspic33fjxxxgpx06/x08/x10 ds70286a-page 198 ? 2007 microchip technology inc. register 18-5: cififo: ecan fifo status register u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? fbp<5:0> bit 15 bit 8 u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? fnrb<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 fbp<5:0> : fifo write buffer pointer bits 011111 = rb31 buffer 011110 = rb30 buffer . . . 000001 = trb1 buffer 000000 = trb0 buffer bit 7-6 unimplemented: read as ? 0 ? bit 5-0 fnrb<5:0> : fifo next read buffer pointer bits 011111 = rb31 buffer 011110 = rb30 buffer . . . 000001 = trb1 buffer 000000 = trb0 buffer
? 2007 microchip technology inc. ds70286a-page 199 dspic33fjxxxgpx06/x08/x10 register 18-6: ciintf: ecan interrupt flag register u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? txbo txbp rxbp txwar rxwar ewarn bit 15 bit 8 r/c-0 r/c-0 r/c-0 u-0 r/c-0 r/c-0 r/c-0 r/c-0 ivrif wakif errif ? fifoif rbovif rbif tbif bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 txbo : transmitter in error state bus off bit bit 12 txbp : transmitter in error state bus passive bit bit 11 rxbp : receiver in error state bus passive bit bit 10 txwar : transmitter in error state warning bit bit 9 rxwar : receiver in error state warning bit bit 8 ewarn : transmitter or receiver in error state warning bit bit 7 ivrif : invalid message received interrupt flag bit bit 6 wakif : bus wake-up activity interrupt flag bit bit 5 errif : error interrupt flag bit (multiple sources in ciintf<13:8> register) bit 4 unimplemented: read as ? 0 ? bit 3 fifoif : fifo almost full interrupt flag bit bit 2 rbovif : rx buffer overflow interrupt flag bit bit 1 rbif : rx buffer interrupt flag bit bit 0 tbif : tx buffer interrupt flag bit
dspic33fjxxxgpx06/x08/x10 ds70286a-page 200 ? 2007 microchip technology inc. register 18-7: ciinte: ecan interrupt enable register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ivrie wakie errie ? fifoie rbovie rbie tbie bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7 ivrie : invalid message received interrupt enable bit bit 6 wakie : bus wake-up activity interrupt flag bit bit 5 errie : error interrupt enable bit bit 4 unimplemented: read as ? 0 ? bit 3 fifoie : fifo almost full interrupt enable bit bit 2 rbovie : rx buffer overflow interrupt enable bit bit 1 rbie : rx buffer interrupt enable bit bit 0 tbie : tx buffer interrupt enable bit
? 2007 microchip technology inc. ds70286a-page 201 dspic33fjxxxgpx06/x08/x10 register 18-8: ciec: ecan transmit/receive error count register r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 terrcnt<7:0> bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 rerrcnt<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 terrcnt<7:0>: transmit error count bits bit 7-0 rerrcnt<7:0> : receive error count bits
dspic33fjxxxgpx06/x08/x10 ds70286a-page 202 ? 2007 microchip technology inc. register 18-9: cicfg1: ecan baud rate configuration register 1 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sjw<1:0> brp<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-6 sjw<1:0>: synchronization jump width bits 11 = length is 4 x t q 10 = length is 3 x t q 01 = length is 2 x t q 00 = length is 1 x t q bit 5-0 brp<5:0>: baud rate prescaler bits 11 1111 = t q = 2 x 64 x 1/f can 00 0010 = t a = 2 x 3 x 1/f can 00 0001 = t a = 2 x 2 x 1/f can 00 0000 = t q = 2 x 1 x 1/f can
? 2007 microchip technology inc. ds70286a-page 203 dspic33fjxxxgpx06/x08/x10 register 18-10: cicfg2: ecan ba ud rate configuratio n register 2 u-0 r/w-x u-0 u-0 u-0 r/w-x r/w-x r/w-x ? wakfil ? ? ? seg2ph<2:0> bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x seg2phts sam seg1ph<2:0> prseg<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14 wakfil: select can bus line filter for wake-up bit 1 = use can bus line filter for wake-up 0 = can bus line filter is not used for wake-up bit 13-11 unimplemented: read as ? 0 ? bit 10-8 seg2ph<2:0>: phase buffer segment 2 bits 111 = length is 8 x t q 000 = length is 1 x t q bit 7 seg2phts: phase segment 2 time select bit 1 = freely programmable 0 = maximum of seg1ph bits or information processing time (ipt), whichever is greater bit 6 sam: sample of the can bus line bit 1 = bus line is sampled three times at the sample point 0 = bus line is sampled once at the sample point bit 5-3 seg1ph<2:0>: phase buffer segment 1 bits 111 = length is 8 x t q 000 = length is 1 x t q bit 2-0 prseg<2:0>: propagation time segment bits 111 = length is 8 x t q 000 = length is 1 x t q
dspic33fjxxxgpx06/x08/x10 ds70286a-page 204 ? 2007 microchip technology inc. register 18-11: cifen1: ecan acceptance filter enable register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flten15 flten14 flten13 flten12 flten11 flten10 flten9 flten8 bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 flten7 flten6 flten5 flten4 flten3 flten2 flten1 flten0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 fltenn: enable filter n to accept messages bits 1 = enable filter n 0 = disable filter n register 18-12: cibufpnt1: ecan fi lter 0-3 buffer pointer register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f3bp<3:0> f2bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f1bp<3:0> f0bp<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f3bp<3:0>: rx buffer written when filter 3 hits bits bit 11-8 f2bp<3:0>: rx buffer written when filter 2 hits bits bit 7-4 f1bp<3:0>: rx buffer written when filter 1 hits bits bit 3-0 f0bp<3:0>: rx buffer written when filter 0 hits bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0
? 2007 microchip technology inc. ds70286a-page 205 dspic33fjxxxgpx06/x08/x10 register 18-13: cibufpnt2: ecan fi lter 4-7 buffer pointer register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f7bp<3:0> f6bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f5bp<3:0> f4bp<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f7bp<3:0>: rx buffer written when filter 7 hits bits bit 11-8 f6bp<3:0>: rx buffer written when filter 6 hits bits bit 7-4 f5bp<3:0>: rx buffer written when filter 5 hits bits bit 3-0 f4bp<3:0>: rx buffer written when filter 4 hits bits register 18-14: cibufpnt3: ecan filter 8-11 buffer pointer register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f11bp<3:0> f10bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f9bp<3:0> f8bp<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f11bp<3:0>: rx buffer written when filter 11 hits bits bit 11-8 f10bp<3:0>: rx buffer written when filter 10 hits bits bit 7-4 f9bp<3:0>: rx buffer written when filter 9 hits bits bit 3-0 f8bp<3:0>: rx buffer written when filter 8 hits bits
dspic33fjxxxgpx06/x08/x10 ds70286a-page 206 ? 2007 microchip technology inc. register 18-15: cibufpnt4: ecan filter 12-15 buffer pointer register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f15bp<3:0> f14bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f13bp<3:0> f12bp<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f15bp<3:0>: rx buffer written when filter 15 hits bits bit 11-8 f14bp<3:0>: rx buffer written when filter 14 hits bits bit 7-4 f13bp<3:0>: rx buffer written when filter 13 hits bits bit 3-0 f12bp<3:0>: rx buffer written when filter 12 hits bits
? 2007 microchip technology inc. ds70286a-page 207 dspic33fjxxxgpx06/x08/x10 register 18-16: cirxfnsid: ecan acceptance filter n standard identifier (n = 0, 1, ..., 15) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid10 sid9 sid8 sid7 sid6 sid5 sid4 sid3 bit 15 bit 8 r/w-x r/w-x r/w-x u-0 r/w-x u-0 r/w-x r/w-x sid2 sid1 sid0 ? exide ?eid17eid16 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 sid<10:0>: standard identifier bits 1 = message address bit sidx must be ? 1 ? to match filter 0 = message address bit sidx must be ? 0 ? to match filter bit 4 unimplemented: read as ? 0 ? bit 3 exide: extended identifier enable bit if mide = 1 then: 1 = match only messages with extended identifier addresses 0 = match only messages with standard identifier addresses if mide = 0 then: ignore exide bit. bit 2 unimplemented: read as ? 0 ? bit 1-0 eid<17:16>: extended identifier bits 1 = message address bit eidx must be ? 1 ? to match filter 0 = message address bit eidx must be ? 0 ? to match filter register 18-17: cirxfneid: ecan acceptance filter n extended identifier (n = 0, 1, ..., 15) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 eid<15:0>: extended identifier bits 1 = message address bit eidx must be ? 1 ? to match filter 0 = message address bit eidx must be ? 0 ? to match filter
dspic33fjxxxgpx06/x08/x10 ds70286a-page 208 ? 2007 microchip technology inc. register 18-18: cifmsksel1: ecan filter 7-0 mask selection register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f7msk<1:0> f6msk<1:0> f5msk<1:0> f4msk<1:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f3msk<1:0> f2msk<1:0> f1msk<1:0> f0msk<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 f7msk<1:0>: mask source for filter 7 bit bit 13-12 f6msk<1:0>: mask source for filter 6 bit bit 11-10 f5msk<1:0>: mask source for filter 5 bit bit 9-8 f4msk<1:0>: mask source for filter 4 bit bit 7-6 f3msk<1:0>: mask source for filter 3 bit bit 5-4 f2msk<1:0>: mask source for filter 2 bit bit 3-2 f1msk<1:0>: mask source for filter 1 bit bit 1-0 f0msk<1:0>: mask source for filter 0 bit 11 = no mask 10 = acceptance mask 2 registers contain mask 01 = acceptance mask 1 registers contain mask 00 = acceptance mask 0 registers contain mask
? 2007 microchip technology inc. ds70286a-page 209 dspic33fjxxxgpx06/x08/x10 register 18-19: cirxmnsid: ecan acceptance filter mask n standard identifier r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid10 sid9 sid8 sid7 sid6 sid5 sid4 sid3 bit 15 bit 8 r/w-x r/w-x r/w-x u-0 r/w-x u-0 r/w-x r/w-x sid2 sid1 sid0 ?mide ?eid17eid16 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 sid<10:0>: standard identifier bits 1 = include bit sidx in filter comparison 0 = bit sidx is don?t care in filter comparison bit 4 unimplemented: read as ? 0 ? bit 3 mide: identifier receive mode bit 1 = match only message types (standard or extended address) that correspond to exide bit in filter 0 = match either standard or extended address message if filters match (i.e., if (filter sid) = (message sid) or if (filter sid/eid) = (message sid/eid)) bit 2 unimplemented: read as ? 0 ? bit 1-0 eid<17:16>: extended identifier bits 1 = include bit eidx in filter comparison 0 = bit eidx is don?t care in filter comparison register 18-20: cirxmneid: ecan acceptance filter mask n extended identifier r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 eid<15:0>: extended identifier bits 1 = include bit eidx in filter comparison 0 = bit eidx is don?t care in filter comparison
dspic33fjxxxgpx06/x08/x10 ds70286a-page 210 ? 2007 microchip technology inc. register 18-21: cirxful1: ecan receive buffer full register 1 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful15 rxful14 rxful13 rxful12 rxful11 rxful10 rxful9 rxful8 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful7 rxful6 rxful5 rxful4 rxful3 rxful2 rxful1 rxful0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxful<15:0>: receive buffer n full bits 1 = buffer is full (set by module) 0 = buffer is empty (clear by application software) register 18-22: cirxful2: ecan receive buffer full register 2 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful31 rxful30 rxful29 rxful28 rxful27 rxful26 rxful25 rxful24 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful23 rxful22 rxful21 rxful20 rxful19 rxful18 rxful17 rxful16 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxful<31:16>: receive buffer n full bits 1 = buffer is full (set by module) 0 = buffer is empty (clear by application software)
? 2007 microchip technology inc. ds70286a-page 211 dspic33fjxxxgpx06/x08/x10 register 18-23: cirxovf1: ecan receive buffer overflow register 1 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf15 rxovf14 rxovf13 rxovf12 rxovf11 rxovf10 rxovf9 rxovf8 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf7 rxovf6 rxovf5 rxovf4 rxovf3 rxovf2 rxovf1 rxovf0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxovf<15:0>: receive buffer n overflow bits 1 = module pointed a write to a full buffer (set by module) 0 = overflow is cleared (clear by application software) register 18-24: cirxovf2: ecan receive buffer overflow register 2 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf31 rxovf30 rxovf29 rxovf28 rxovf27 rxovf26 rxovf25 rxovf24 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf23 rxovf22 rxovf21 rxovf20 rxovf19 rxovf18 rxovf17 rxovf16 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxovf<31:16>: receive buffer n overflow bits 1 = module pointed a write to a full buffer (set by module) 0 = overflow is cleared (clear by application software)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 212 ? 2007 microchip technology inc. register 18-25: citrmncon: ecan tx/rx buffer m control register (m = 0,2,4,6; n = 1,3,5,7) r/w-0 r-0 r-0 r-0 r/w-0 r/w-0 r/w-0 r/w-0 txenn txabtn txlarbn txerrn txreqn rtrenn txnpri<1:0> bit 15 bit 8 r/w-0 r-0 r-0 r-0 r/w-0 r/w-0 r/w-0 r/w-0 txenm txabtm (1) txlarbm (1) txerrm (1) txreqm rtrenm txmpri<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 see definition for bits 7-0, controls buffer n bit 7 txenm: tx/rx buffer selection bit 1 = buffer trbn is a transmit buffer 0 = buffer trbn is a receive buffer bit 6 txabtm: message aborted bit (1) 1 = message was aborted 0 = message completed transmission successfully bit 5 txlarbm: message lost arbitration bit (1) 1 = message lost arbitration while being sent 0 = message did not lose arbitration while being sent bit 4 txerrm: error detected during transmission bit (1) 1 = a bus error occurred while the message was being sent 0 = a bus error did not occur while the message was being sent bit 3 txreqm: message send request bit setting this bit to ? 1 ? requests sending a message. the bit will automatically clear when the message is successfully sent. clearing the bit to ? 0 ? while set will request a message abort. bit 2 rtrenm: auto-remote transmit enable bit 1 = when a remote transmit is received, txreq will be set 0 = when a remote transmit is received, txreq will be unaffected bit 1-0 txmpri<1:0>: message transmission priority bits 11 = highest message priority 10 = high intermediate message priority 01 = low intermediate message priority 00 = lowest message priority note 1: this bit is cleared when txreq is set.
? 2007 microchip technology inc. ds70286a-page 213 dspic33fjxxxgpx06/x08/x10 note: the buffers, sid, eid, dlc, data field and receive status registers are located in dma ram. register 18-26: citrbnsid: ecan buffer n standard identifier (n = 0, 1, ..., 31) u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? sid10 sid9 sid8 sid7 sid6 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid5 sid4 sid3 sid2 sid1 sid0 srr ide bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-2 sid<10:0>: standard identifier bits bit 1 srr: substitute remote request bit 1 = message will request remote transmission 0 = normal message bit 0 ide: extended identifier bit 1 = message will transmit extended identifier 0 = message will transmit standard identifier register 18-27: citrbneid: ecan buffer n extended identifier (n = 0, 1, ..., 31) u-0 u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x ? ? ? ? eid17 eid16 eid15 eid14 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid13 eid12 eid11 eid10 eid9 eid8 eid7 eid6 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-0 eid<17:6>: extended identifier bits
dspic33fjxxxgpx06/x08/x10 ds70286a-page 214 ? 2007 microchip technology inc. register 18-28: citrbndlc: ecan buffer n da ta length control (n = 0, 1, ..., 31) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid5 eid4 eid3 eid2 eid1 eid0 rtr rb1 bit 15 bit 8 u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? rb0 dlc3 dlc2 dlc1 dlc0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 eid<5:0>: extended identifier bits bit 9 rtr: remote transmission request bit 1 = message will request remote transmission 0 = normal message bit 8 rb1: reserved bit 1 user must set this bit to ? 0 ? per can protocol. bit 7-5 unimplemented: read as ? 0 ? bit 4 rb0: reserved bit 0 user must set this bit to ? 0 ? per can protocol. bit 3-0 dlc<3:0>: data length code bits register 18-29: citrbndm: ecan buffer n data field byte m (n = 0, 1, ..., 31; m = 0, 1, ..., 7) (1) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x trbndm7 trbndm6 trbndm5 trbndm4 trbndm3 trbndm2 trbndm1 trbndm0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 7-0 trndm<7:0>: data field buffer ?n? byte ?m? bits note 1: the most significant byte contains byte (m + 1) of the buffer.
? 2007 microchip technology inc. ds70286a-page 215 dspic33fjxxxgpx06/x08/x10 register 18-30: citrbnstat: ecan receive buffer n status (n = 0, 1, ..., 31) u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? filhit4 filhit3 filhit2 filhit1 filhit0 bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-8 filhit<4:0>: filter hit code bits (only written by module for receive buffers, unused for transmit buffers) encodes number of filter that resulted in writing this buffer. bit 7-0 unimplemented: read as ? 0 ?
dspic33fjxxxgpx06/x08/x10 ds70286a-page 216 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 217 dspic33fjxxxgpx06/x08/x10 19.0 data converter interface (dci) module 19.1 module introduction the dspic33fjxxxgpx06/x08/x10 data converter interface (dci) module allows simple interfacing of devices, such as audio coder/decoders (codecs), adc and d/a converters. the following interfaces are sup- ported: ? framed synchronous serial transfer (single or multi-channel) ? inter-ic sound (i 2 s) interface ? ac-link compliant mode the dci module provides the following general features: ? programmable word size up to 16 bits ? supports up to 16 time slots, for a maximum frame size of 256 bits ? data buffering for up to 4 samples without cpu overhead 19.2 module i/o pins there are four i/o pins associated with the module. when enabled, the module controls the data direction of each of the four pins. 19.2.1 csck pin the csck pin provides the serial clock for the dci module. the csck pin may be configured as an input or output using the csckd control bit in the dcicon1 sfr. when configured as an output, the serial clock is provided by the dspic33fjxxxgpx06/x08/x10. when configured as an input, the serial clock must be provided by an external device. 19.2.2 csdo pin the serial data output (csdo) pin is configured as an output only pin when the module is enabled. the csdo pin drives the serial bus whenever data is to be transmitted. the csdo pin is tri-stated, or driven to ? 0 ?, during csck periods when data is not transmitted depending on the state of the csdom control bit. this allows other devices to place data on the serial bus during transmission periods not used by the dci module. 19.2.3 csdi pin the serial data input (csdi) pin is configured as an input only pin when the module is enabled. 19.2.3.1 cofs pin the codec frame synchronization (cofs) pin is used to synchronize data transfers that occur on the csdo and csdi pins. the cofs pin may be configured as an input or an output. the data direction for the cofs pin is determined by the cofsd control bit in the dcicon1 register. the dci module accesses the shadow registers while the cpu is in the process of accessing the memory mapped buffer registers. 19.2.4 buffer data alignment data values are always stored left justified in the buffers since most codec data is represented as a signed 2?s complement fractional number. if the received word length is less than 16 bits, the unused least significant bits in the receive buffer registers are set to ? 0 ? by the module. if the transmitted word length is less than 16 bits, the unused lsbs in the transmit buffer register are ignored by the module. the word length setup is described in subsequent sections of this document. 19.2.5 transmit/receive shift register the dci module has a 16-bit shift register for shifting serial data in and out of the module. data is shifted in/ out of the shift register, msb first, since audio pcm data is transmitted in signed 2?s complement format. 19.2.6 dci buffer control the dci module contains a buffer control unit for transferring data between the shadow buffer memory and the serial shift register. the buffer control unit is a simple 2-bit address counter that points to word loca- tions in the shadow buffer memory. for the receive memory space (high address portion of dci buffer memory), the address counter is concatenated with a ? 0 ? in the msb location to form a 3-bit address. for the transmit memory space (high portion of dci buffer memory), the address counter is concatenated with a ? 1 ? in the msb location. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note: the dci buffer control unit always accesses the same relative location in the transmit and receive buffers, so only one address counter is provided.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 218 ? 2007 microchip technology inc. figure 19-1: dci module block diagram bcg control bits 16-bit data bus sample rate generator sckd fsd dci buffer frame synchronization generator control unit dci shift register receive buffer registers w/shadow f osc /4 word size selection bits frame length selection bits dci mode selection bits csck cofs csdi csdo 15 0 transmit buffer registers w/shadow
? 2007 microchip technology inc. ds70286a-page 219 dspic33fjxxxgpx06/x08/x10 19.3 dci module operation 19.3.1 module enable the dci module is enabled or disabled by setting/ clearing the dcien control bit in the dcicon1 sfr. clearing the dcien control bit has the effect of reset- ting the module. in particular, all counters associated with csck generation, frame sync and the dci buffer control unit are reset. the dci clocks are shut down when the dcien bit is cleared. when enabled, the dci controls the data direction for the four i/o pins associated with the module. the port, lat and tris register values for these i/o pins are overridden by the dci module when the dcien bit is set. it is also possible to override the csck pin separately when the bit clock generator is enabled. this permits the bit clock generator to operate without enabling the rest of the dci module. 19.3.2 word size selection bits the ws<3:0> word size selection bits in the dcicon2 sfr determine the number of bits in each dci data word. essentially, the ws<3:0> bits determine the counting period for a 4-bit counter clocked from the csck signal. any data length, up to 16-bits, may be selected. the value loaded into the ws<3:0> bits is one less the desired word length. for example, a 16-bit data word size is selected when ws<3:0> = 1111 . 19.3.3 frame sync generator the frame sync generator (cofsg) is a 4-bit counter that sets the frame length in data words. the frame sync generator is incremented each time the word size counter is reset (refer to section 19.3.2 ?word size selection bits? ). the period for the frame synchroni- zation generator is set by writing the cofsg<3:0> control bits in the dcicon2 sfr. the cofsg period in clock cycles is determined by the following formula: equation 19-1: cofsg period frame lengths, up to 16 data words, may be selected. the frame length in csck periods can vary up to a maximum of 256 depending on the word size that is selected. 19.3.4 frame sync mode control bits the type of frame sync signal is selected using the frame synchronization mode control bits (cofsm<1:0>) in the dcicon1 sfr. the following operating modes can be selected: ? multi-channel mode ?i 2 s mode ? ac-link mode (16-bit) ? ac-link mode (20-bit) the operation of the cofsm control bits depends on whether the dci module generates the frame sync signal as a master device, or receives the frame sync signal as a slave device. the master device in a dsp/codec pair is the device that generates the frame sync signal. the frame sync signal initiates data transfers on the csdi and csdo pins and usually has the same frequency as the data sample rate (cofs). the dci module is a frame sync master if the cofsd control bit is cleared and is a frame sync slave if the cofsd control bit is set. 19.3.5 master frame sync operation when the dci module is operating as a frame sync master device (cofsd = 0 ), the cofsm mode bits determine the type of frame sync pulse that is generated by the frame sync generator logic. a new cofs signal is generated when the frame sync generator resets to ? 0 ?. in the multi-channel mode, the frame sync pulse is driven high for the csck period to initiate a data trans- fer. the number of csck cycles between successive frame sync pulses will depend on the word size and frame sync generator control bits. a timing diagram for the frame sync signal in multi-channel mode is shown in figure 19-2. in the ac-link mode of operation, the frame sync sig- nal has a fixed period and duty cycle. the ac-link frame sync signal is high for 16 csck cycles and is low for 240 csck cycles. a timing diagram with the timing details at the start of an ac-link frame is shown in figure 19-3. in the i 2 s mode, a frame sync signal having a 50% duty cycle is generated. the period of the i 2 s frame sync signal in csck cycles is determined by the word size and frame sync generator control bits. a new i 2 s data transfer boundary is marked by a high-to-low or a low-to-high transition edge on the cofs pin. note: these ws<3:0> control bits are used only in the multi-channel and i 2 s modes. these bits have no effect in ac-link mode since the data slot sizes are fixed by the protocol. note: the cofsg control bits will have no effect in ac-link mode since the frame length is set to 256 csck periods by the protocol. frame length = word length ? (fsg value + 1)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 220 ? 2007 microchip technology inc. 19.3.6 slave frame sync operation when the dci module is operating as a frame sync slave (cofsd = 1 ), data transfers are controlled by the codec device attached to the dci module. the cofsm control bits control how the dci module responds to incoming cofs signals. in the multi-channel mode, a new data frame transfer will begin one csck cycle after the cofs pin is sam- pled high (see figure 19-2). the pulse on the cofs pin resets the frame sync generator logic. in the i 2 s mode, a new data word will be transferred one csck cycle after a low-to-high or a high-to-low transition is sampled on the cofs pin. a rising or fall- ing edge on the cofs pin resets the frame sync generator logic. in the ac-link mode, the tag slot and subsequent data slots for the next frame will be transferred one csck cycle after the cofs pin is sampled high. the cofsg and ws bits must be configured to pro- vide the proper frame length when the module is oper- ating in the slave mode. once a valid frame sync pulse has been sampled by the module on the cofs pin, an entire data frame transfer will take place. the module will not respond to further frame sync pulses until the data frame transfer has completed. figure 19-2: frame sync timing, multi-channel mode figure 19-3: frame sync timi ng, ac-link start-of-frame figure 19-4: i 2 s interface frame sync timing csck csdi/csdo cofs msb lsb ta g msb bit_clk csdo or csdi sync ta g bit 14 s12 lsb s12 bit 1 s12 bit 2 ta g bit 13 msb lsb msb lsb csck csdi or csdo ws note: a 5-bit transfer is shown here fo r illustration purposes. the i 2 s protocol does not specify word length ? this will be system dependent.
? 2007 microchip technology inc. ds70286a-page 221 dspic33fjxxxgpx06/x08/x10 19.3.7 bit clock generator the dci module has a dedicated 12-bit time base that produces the bit clock. the bit clock rate (period) is set by writing a non-zero 12-bit value to the bcg<11:0> control bits in the dcicon3 sfr. when the bcg<11:0> bits are set to zero, the bit clock will be disabled. if the bcg<11:0> bits are set to a non- zero value, the bit clock generator is enabled. these bits should be set to ? 0 ? and the csckd bit set to ? 1 ? if the serial clock for the dci is received from an external device. the formula for the bit clock frequency is given in equation 19-2. equation 19-2: bit clock frequency the required bit clock frequency will be determined by the system sampling rate and frame size. typical bit clock frequencies range from 16x to 512x the converter sample rate depending on the data converter and the communication protocol that is used. to achieve bit clock frequencies associated with com- mon audio sampling rates, the user will need to select a crystal frequency that has an ?even? binary value. examples of such crystal frequencies are listed in table 19-1. table 19-1: device frequencies for common codec csck frequencies f bck = f cy 2 (bcg + 1) ? f s (khz) f csck /f s f csck (mhz) (1) f osc (mh z )pll f cy (mips) bcg (2) 8 256 2.048 8.192 4 8.192 1 12 256 3.072 6.144 8 12.288 1 32 32 1.024 8.192 8 16.384 7 44.1 32 1.4112 5.6448 8 11.2896 3 48 64 3.072 6.144 16 24.576 3 note 1: when the csck signal is applied externally (csckd = 1 ), the external clock high and low times must meet the device timing requirements. 2: when the csck signal is applied externally (csckd = 1 ), the bcg<11:0> bits have no effect on the operation of the dci module.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 222 ? 2007 microchip technology inc. 19.3.8 sample clock edge control bit the sample clock edge (cscke) control bit determines the sampling edge for the csck signal. if the csck bit is cleared (default), data will be sampled on the falling edge of the csck signal. the ac-link protocols and most multi-channel formats require that data be sam- pled on the falling edge of the csck signal. if the csck bit is set, data will be sampled on the rising edge of csck. the i 2 s protocol requires that data be sampled on the rising edge of the csck signal. 19.3.9 data justification control bit in most applications, the data transfer begins one csck cycle after the cofs signal is sampled active. this is the default configuration of the dci module. an alternate data alignment can be selected by setting the djst control bit in the dcicon1 sfr. when djst = 1 , data transfers will begin during the same csck cycle when the cofs signal is sampled active. 19.3.10 transmit slot enable bits the tscon sfr has control bits that are used to enable up to 16 time slots for transmission. these con- trol bits are the tse<15:0> bits. the size of each time slot is determined by the ws<3:0> word size selection bits and can vary up to 16 bits. if a transmit time slot is enabled via one of the tse bits (tsex = 1 ), the contents of the current transmit shadow buffer location will be loaded into the dci shift register and the dci buffer control unit is incremented to point to the next location. during an unused transmit time slot, the csdo pin will drive ? 0 ?s, or will be tri-stated during all disabled time slots, depending on the state of the csdom bit in the dcicon1 sfr. the data frame size in bits is determined by the chosen data word size and the number of data word elements in the frame. if the chosen frame size has less than 16 elements, the additional slot enable bits will have no effect. each transmit data word is written to the 16-bit transmit buffer as left justified data. if the selected word size is less than 16 bits, then the lsbs of the transmit buffer memory will have no effect on the transmitted data. the user should write ? 0 ?s to the unused lsbs of each transmit buffer location. 19.3.11 receive slot enable bits the rscon sfr contains control bits that are used to enable up to 16 time slots for reception. these control bits are the rse<15:0> bits. the size of each receive time slot is determined by the ws<3:0> word size selection bits and can vary from 1 to 16 bits. if a receive time slot is enabled via one of the rse bits (rsex = 1 ), the dci shift register contents will be writ- ten to the current dci receive shadow buffer location and the buffer control unit will be incremented to point to the next buffer location. data is not packed in the receive memory buffer loca- tions if the selected word size is less than 16 bits. each received slot data word is stored in a separate 16-bit buffer location. data is always stored in a left justified format in the receive memory buffer. 19.3.12 slot enable bits operation with frame sync the tse and rse control bits operate in concert with the dci frame sync generator. in master mode, a cofs signal is generated whenever the frame sync generator is reset. in slave mode, the frame sync generator is reset whenever a cofs pulse is received. the tse and rse control bits allow up to 16 consecu- tive time slots to be enabled for transmit or receive. after the last enabled time slot has been transmitted/ received, the dci will stop buffering data until the next occurring cofs pulse. 19.3.13 synchronous data transfers the dci buffer control unit will be incremented by one word location whenever a given time slot has been enabled for transmission or reception. in most cases, data input and output transfers will be synchronized, which means that a data sample is received for a given channel at the same time a data sample is transmitted. therefore, the transmit and receive buffers will be filled with equal amounts of data when a dci interrupt is generated. in some cases, the amount of data transmitted and received during a data frame may not be equal. as an example, assume a two-word data frame is used. furthermore, assume that data is only received during slot #0 but is transmitted during slot #0 and slot #1. in this case, the buffer control unit counter would be incre- mented twice during a data frame, but only one receive register location would be filled with data. 19.3.14 buffer length control the amount of data that is buffered between interrupts is determined by the buffer length (blen<1:0>) con- trol bits in the dcicon2 sfr. the size of the transmit and receive buffers can vary from 1 to 4 data words using the blen control bits. the blen control bits are compared to the current value of the dci buffer control unit address counter. when the 2 lsbs of the dci address counter match the blen<1:0> value, the buffer control unit will be reset to ? 0 ?. in addition, the contents of the receive shadow registers are trans-
? 2007 microchip technology inc. ds70286a-page 223 dspic33fjxxxgpx06/x08/x10 ferred to the receive buffer registers and the contents of the transmit buffer registers are transferred to the transmit shadow registers. 19.3.15 buffer alignment with data frames there is no direct coupling between the position of the agu address pointer and the data frame boundaries. this means that there will be an implied assignment of each transmit and receive buffer that is a function of the blen control bits and the number of enabled data slots via the tse and rse control bits. as an example, assume that a 4-word data frame is chosen and that we want to transmit on all four time slots in the frame. this configuration would be estab- lished by setting the tse0, tse1, tse2 and tse3 control bits in the tscon sfr. with this module setup, the txbuf0 register would naturally be assigned to slot #0, the txbuf1 register would naturally be assigned to slot #1, and so on. 19.3.16 transmit status bits there are two transmit status bits in the dcistat sfr. the tmpty bit is set when the contents of the transmit buffer registers are transferred to the transmit shadow registers. the tmpty bit may be polled in software to determine when the transmit buffer registers may be written. the tmpty bit is cleared automatically by the hardware when a write to one of the four transmit buffers occurs. the tunf bit is read-only and indicates that a transmit underflow has occurred for at least one of the transmit buffer registers that is in use. the tunf bit is set at the time the transmit buffer registers are transferred to the transmit shadow registers. the tunf status bit is cleared automatically when the buffer register that underflowed is written by the cpu. 19.3.17 receive status bits there are two receive status bits in the dcistat sfr. the rful status bit is read-only and indicates that new data is available in the receive buffers. the rful bit is cleared automatically when all receive buffers in use have been read by the cpu. the rov status bit is read-only and indicates that a receive overflow has occurred for at least one of the receive buffer locations. a receive overflow occurs when the buffer location is not read by the cpu before new data is transferred from the shadow registers. the rov status bit is cleared automatically when the buffer register that caused the overflow is read by the cpu. when a receive overflow occurs for a specific buffer location, the old contents of the buffer are overwritten. note 1: dci can trigger a dma data transfer. if dci is selected as a dma irq source, a dma transfer occurs when the dciif bit gets set as a result of a dci transmission or reception. 2: if dma transfers are required, the dci tx/rx buffer must be set to a size of 1 word (i.e., blen<1:0> = 00 ). note: when more than four time slots are active within a data frame, the user code must keep track of which time slots are to be read/written at each interrupt. in some cases, the alignment between transmit/ receive buffers and their respective slot assignments could be lost. examples of such cases include an emulation break- point or a hardware trap. in these situations, the user should poll the slot status bits to determine what data should be loaded into the buffer registers to resynchronize the software with the dci module. note: the transmit status bits only indicate status for buffer locations that are used by the module. if the buffer length is set to less than four words, for example, the unused buffer locations will not affect the transmit status bits. note: the receive status bits only indicate status for buffer locations that are used by the module. if the buffer length is set to less than four words, for example, the unused buffer locations will not affect the transmit status bits.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 224 ? 2007 microchip technology inc. 19.3.18 slot status bits the slot<3:0> status bits in the dcistat sfr indicate the current active time slot. these bits will cor- respond to the value of the frame sync generator counter. the user may poll these status bits in software when a dci interrupt occurs to determine what time slot data was last received and which time slot data should be loaded into the txbuf registers. 19.3.19 csdo mode bit the csdom control bit controls the behavior of the csdo pin during unused transmit slots. a given trans- mit time slot is unused if it?s corresponding tsex bit in the tscon sfr is cleared. if the csdom bit is cleared (default), the csdo pin will be low during unused time slot periods. this mode will be used when there are only two devices attached to the serial bus. if the csdom bit is set, the csdo pin will be tri-stated during unused time slot periods. this mode allows multiple devices to share the same csdo line in a multi-channel application. each device on the csdo line is configured to only transmit data during specific time slots. no two devices will transmit data during the same time slot. 19.3.20 digital loopback mode digital loopback mode is enabled by setting the dloop control bit in the dcicon1 sfr. when the dloop bit is set, the module internally connects the csdo signal to csdi. the actual data input on the csdi i/o pin will be ignored in digital loopback mode. 19.3.21 underflow mo de control bit when an underflow occurs, one of two actions can occur, depending on the state of the underflow mode (unfm) control bit in the dcicon1 sfr. if the unfm bit is cleared (default), the module will transmit ? 0 ?s on the csdo pin during the active time slot for the buffer location. in this operating mode, the codec device attached to the dci module will simply be fed digital ?silence?. if the unfm control bit is set, the module will transmit the last data written to the buffer location. this operating mode permits the user to send continuous data to the codec device without consuming cpu overhead. 19.4 dci module interrupts the frequency of dci module interrupts is dependent on the blen<1:0> control bits in the dcicon2 sfr. an interrupt to the cpu is generated each time the set buffer length has been reached and a shadow register transfer takes place. a shadow register transfer is defined as the time when the previously written txbuf values are transferred to the transmit shadow registers and new received values in the receive shadow registers are transferred into the rxbuf registers. 19.5 dci module operation during cpu sleep and idle modes 19.5.1 dci module operation during cpu sleep mode the dci module has the ability to operate while in sleep mode and wake the cpu when the csck signal is supplied by an external device (csckd = 1 ). the dci module will generate an asynchronous interrupt when a dci buffer transfer has completed and the cpu is in sleep mode. 19.5.2 dci module operation during cpu idle mode if the dcisidl control bit is cleared (default), the mod- ule will continue to operate normally even in idle mode. if the dcisidl bit is set, the module will halt when idle mode is asserted. 19.6 ac-link mode operation the ac-link protocol is a 256-bit frame with one 16-bit data slot, followed by twelve 20-bit data slots. the dci module has two operating modes for the ac-link pro- tocol. these operating modes are selected by the cofsm<1:0> control bits in the dcicon1 sfr. the first ac-link mode is called ?16-bit ac-link mode? and is selected by setting cofsm<1:0> = 10 . the second ac-link mode is called ?20-bit ac-link mode? and is selected by setting cofsm<1:0> = 11 . 19.6.1 16-bit ac-link mode in the 16-bit ac-link mode, data word lengths are restricted to 16 bits. note that this restriction only affects the 20-bit data time slots of the ac-link proto- col. for received time slots, the incoming data is simply truncated to 16 bits. for outgoing time slots, the four least significant bits of the data word are set to ? 0 ? by the module. this truncation of the time slots limits the adc and dac data to 16 bits but permits proper data alignment in the txbuf and rxbuf registers. each rxbuf and txbuf register will contain one data time slot value.
? 2007 microchip technology inc. ds70286a-page 225 dspic33fjxxxgpx06/x08/x10 19.6.2 20-bit ac-link mode the 20-bit ac-link mode allows all bits in the data time slots to be transmitted and received but does not main- tain data alignment in the txbuf and rxbuf registers. the 20-bit ac-link mode functions similar to the multi- channel mode of the dci module, except for the duty cycle of the frame synchronization signal. the ac-link frame synchronization signal should remain high for 16 csck cycles and should be low for the following 240 cycles. the 20-bit mode treats each 256-bit ac-link frame as sixteen, 16-bit time slots. in the 20-bit ac-link mode, the module operates as if cofsg<3:0> = 1111 and ws<3:0> = 1111 . the data alignment for 20-bit data slots is ignored. for example, an entire ac-link data frame can be transmitted and received in a packed fashion by setting all bits in the tscon and rscon sfrs. since the total available buffer length is 64 bits, it would take 4 consecutive interrupts to transfer the ac-link frame. the application software must keep track of the current ac-link frame segment. 19.7 i 2 s mode operation the dci module is configured for i 2 s mode by writing a value of ? 01 ? to the cofsm<1:0> control bits in the dcicon1 sfr. when operating in the i 2 s mode, the dci module will generate frame synchronization sig- nals with a 50% duty cycle. each edge of the frame synchronization signal marks the boundary of a new data word transfer. the user must also select the frame length and data word size using the cofsg and ws control bits in the dcicon2 sfr. 19.7.1 i 2 s frame and data word length selection the ws and cofsg control bits are set to produce the period for one half of an i 2 s data frame. that is, the frame length is the total number of csck cycles required for a left or right data word transfer. the blen bits must be set for the desired buffer length. setting blen<1:0> = 01 will produce a cpu interrupt, once per i 2 s frame. 19.7.2 i 2 s data justification as per the i 2 s specification, a data word transfer will, by default, begin one csck cycle after a transition of the ws signal. a ?most significant bit left justified? option can be selected using the djst control bit in the dcicon1 sfr. if djst = 1 , the i 2 s data transfers will be msb left justified. the msb of the data word will be presented on the csdo pin during the same csck cycle as the rising or falling edge of the cofs signal. the csdo pin is tri-stated after the data word has been sent.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 226 ? 2007 microchip technology inc. register 19-1: dcicon1: dci control register 1 r/w-0 u-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 dcien ? dcisidl ? dloop csckd cscke cofsd bit 15 bit 8 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 r/w-0 unfm csdom djst ? ? ?cofsm<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 dcien: dci module enable bit 1 = module is enabled 0 = module is disabled bit 14 reserved: read as ? 0 ? bit 13 dcisidl: dci stop in idle control bit 1 = module will halt in cpu idle mode 0 = module will continue to operate in cpu idle mode bit 12 reserved: read as ? 0 ? bit 11 dloop: digital loopback mode control bit 1 = digital loopback mode is enabled. csdi and csdo pins internally connected. 0 = digital loopback mode is disabled bit 10 csckd: sample clock direction control bit 1 = csck pin is an input when dci module is enabled 0 = csck pin is an output when dci module is enabled bit 9 cscke: sample clock edge control bit 1 = data changes on serial clock falling edge, sampled on serial clock rising edge 0 = data changes on serial clock rising edge, sampled on serial clock falling edge bit 8 cofsd: frame synchronization direction control bit 1 = cofs pin is an input when dci module is enabled 0 = cofs pin is an output when dci module is enabled bit 7 unfm: underflow mode bit 1 = transmit last value written to the transmit registers on a transmit underflow 0 = transmit ? 0 ?s on a transmit underflow bit 6 csdom: serial data output mode bit 1 = csdo pin will be tri-stated during disabled transmit time slots 0 = csdo pin drives ? 0 ?s during disabled transmit time slots bit 5 djst: dci data justification control bit 1 = data transmission/reception is begun during the same serial clock cycle as the frame synchronization pulse 0 = data transmission/reception is begun one serial clock cycle after frame synchronization pulse bit 4-2 reserved: read as ? 0 ? bit 1-0 cofsm<1:0>: frame sync mode bits 11 = 20-bit ac-link mode 10 = 16-bit ac-link mode 01 = i 2 s frame sync mode 00 = multi-channel frame sync mode
? 2007 microchip technology inc. ds70286a-page 227 dspic33fjxxxgpx06/x08/x10 register 19-2: dcicon2: dci control register 2 u-0 u-0 u-0 u-0 r/w-0 r/w-0 u-0 r/w-0 ? ? ? ? blen<1:0> ?cofsg3 bit 15 bit 8 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 cofsg<2:0> ?ws<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 reserved: read as ? 0 ? bit 11-10 blen<1:0>: buffer length control bits 11 = four data words will be buffered between interrupts 10 = three data words will be buffered between interrupts 01 = two data words will be buffered between interrupts 00 = one data word will be buffered between interrupts bit 9 reserved: read as ? 0 ? bit 8-5 cofsg<3:0>: frame sync generator control bits 1111 = data frame has 16 words ? ? ? 0010 = data frame has 3 words 0001 = data frame has 2 words 0000 = data frame has 1 word bit 4 reserved: read as ? 0 ? bit 3-0 ws<3:0>: dci data word size bits 1111 = data word size is 16 bits ? ? ? 0100 = data word size is 5 bits 0011 = data word size is 4 bits 0010 = invalid selection . do not use. unexpected results may occur. 0001 = invalid selection . do not use. unexpected results may occur. 0000 = invalid selection . do not use. unexpected results may occur.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 228 ? 2007 microchip technology inc. register 19-3: dcicon3: dci control register 3 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ?bcg<11:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 bcg<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 reserved: read as ? 0 ? bit 11-0 bcg<11:0>: dci bit clock generator control bits
? 2007 microchip technology inc. ds70286a-page 229 dspic33fjxxxgpx06/x08/x10 register 19-4: dcistat: dci status register u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ? slot<3:0> bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ? rov rful tunf tmpty bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 reserved: read as ? 0 ? bit 11-8 slot<3:0>: dci slot status bits 1111 = slot #15 is currently active ? ? ? 0010 = slot #2 is currently active 0001 = slot #1 is currently active 0000 = slot #0 is currently active bit 7-4 reserved: read as ? 0 ? bit 3 rov: receive overflow status bit 1 = a receive overflow has occurred for at least one receive register 0 = a receive overflow has not occurred bit 2 rful: receive buffer full status bit 1 = new data is available in the receive registers 0 = the receive registers have old data bit 1 tunf: transmit buffer underflow status bit 1 = a transmit underflow has occurred for at least one transmit register 0 = a transmit underflow has not occurred bit 0 tmpty: transmit buffer empty status bit 1 = the transmit registers are empty 0 = the transmit registers are not empty
dspic33fjxxxgpx06/x08/x10 ds70286a-page 230 ? 2007 microchip technology inc. register 19-5: rscon: dci re ceive slot control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rse15 rse14 rse13 rse12 rse11 rse10 rse9 rse8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rse7 rse6 rse5 rse4 rse3 rse2 rse1 rse0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rse<15:0>: receive slot enable bits 1 = csdi data is received during the individual time slot n 0 = csdi data is ignored during the individual time slot n register 19-6: tscon: dci tran smit slot control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 tse15 tse14 tse13 tse12 tse11 tse10 tse9 tse8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 tse7 tse6 tse5 tse4 tse3 tse2 tse1 tse0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 tse<15:0>: transmit slot enable control bits 1 = transmit buffer contents are sent during the individual time slot n 0 = csdo pin is tri-stated or driven to logic ? 0 ?, during the individual time slot, depending on the state of the csdom bit
? 2007 microchip technology inc. ds70286a-page 231 dspic33fjxxxgpx06/x08/x10 20.0 10-bit/12-bit analog-to-digital converter (adc) the dspic33fjxxxgpx06/x08/x10 devices have up to 32 adc input channels. these devices also have up to 2 adc modules (adcx, where ?x? = 1 or 2), each with its own set of special function registers. the ad12b bit (adxcon1<10>) allows each of the adc modules to be configured by the user as either a 10-bit, 4-sample/hold adc (default configuration) or a 12-bit, 1-sample/hold adc. 20.1 key features the 10-bit adc configuration has the following key features: ? successive approximation (sar) conversion ? conversion speeds of up to 1.1 msps ? up to 32 analog input pins ? external voltage reference input pins ? simultaneous sampling of up to four analog input pins ? automatic channel scan mode ? selectable conversion trigger source ? selectable buffer fill modes ? four result alignment options (signed/unsigned, fractional/integer) ? operation during cpu sleep and idle modes the 12-bit adc configuration supports all the above features, except: ? in the 12-bit configuration, conversion speeds of up to 500 ksps are supported ? there is only 1 sample/hold amplifier in the 12-bit configuration, so simultaneous sampling of multiple channels is not supported. depending on the particular device pinout, the adc can have up to 32 analog input pins, designated an0 through an31. in addition, there are two analog input pins for external voltage reference connections. these voltage reference inputs may be shared with other ana- log input pins. the actual number of analog input pins and external voltage reference input configuration will depend on the specific device. refer to the device data sheet for further details. a block diagram of the adc is shown in figure 20-1. 20.2 adc initialization the following configuration steps should be performed. 1. configure the adc module: a) select port pins as analog inputs (adxpcfgh<15:0> or adxpcfgl<15:0>) b) select voltage reference source to match expected range on analog inputs (adxcon2<15:13>) c) select the analog conversion clock to match desired data rate with processor clock (adxcon3<5:0>) d) determine how many s/h channels will be used (adxcon2<9:8> and adxpcfgh<15:0> or adxpcfgl<15:0>) e) select the appropriate sample/conversion sequence (adxcon1<7:5> and adxcon3<12:8>) f) select how conversion results are presented in the buffer (adxcon1<9:8>) g) turn on adc module (adxcon1<15>) 2. configure adc interrupt (if required): a) clear the adxif bit b) select adc interrupt priority 20.3 adc and dma if more than one conversion result needs to be buffered before triggering an interrupt, dma data transfers can be used. both adc1 and adc2 can trigger a dma data transfer. if adc1 or adc2 is selected as the dma irq source, a dma transfer occurs when the ad1if or ad2if bit gets set as a result of an adc1 or adc2 sample conversion sequence. the smpi<3:0> bits (adxcon2<5:2>) are used to select how often the dma ram buffer pointer is incremented. the addmabm bit (adxcon1<12>) determines how the conversion results are filled in the dma ram buffer area being used for adc. if this bit is set, dma buffers are written in the order of conversion. the module will provide an address to the dma channel that is the same as the address used for the non-dma stand-alone buffer. if the addmabm bit is cleared, then dma buffers are written in scatter/gather mode. the module will provide a scatter/gather address to the dma channel, based on the index of the analog input and the size of the dma buffer. note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. note: the adc module needs to be disabled before modifying the ad12b bit.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 232 ? 2007 microchip technology inc. figure 20-1: adc1 modul e block diagram s/h + - conversion conversion logic v ref + (1) av ss av dd adc1 data format 16-bit adc output bus interface 00000 00101 00111 01001 11110 11111 00001 00010 00011 00100 00110 01000 01010 01011 an30 an31 an8 an9 an10 an11 an2 an4 an7 an0 an3 an1 an5 ch1 (2) ch2 (2) ch3 (2) ch0 an5 an2 an11 an8 v ref - an4 an1 an10 an7 v ref - an3 an0 an9 an6 v ref - an1 v ref - v ref - (1) sample/sequence control sample ch1,ch2, ch3,ch0 input mux control input switches s/h + - s/h + - s/h + - an6 buffer result note 1: v ref +, v ref - inputs may be multiplexed with other analog inputs. see device data sheet for details. 2: channels 1, 2 and 3 are not applicable for the 12-bit mode of operation.
? 2007 microchip technology inc. ds70286a-page 233 dspic33fjxxxgpx06/x08/x10 figure 20-2: adc2 mo dule block diagram (1) s/h + - conversion conversion logic v ref + (2) av ss av dd adc2 data format 16-bit adc output bus interface 00000 00101 00111 01001 11110 11111 00001 00010 00011 00100 00110 01000 01010 01011 an14 an15 an8 an9 an10 an11 an2 an4 an7 an0 an3 an1 an5 ch1 (3) ch2 (3) ch3 (3) ch0 an5 an2 an11 an8 v ref - an4 an1 an10 an7 v ref - an3 an0 an9 an6 v ref - an1 v ref - v ref - (2) sample/sequence control sample ch1,ch2, ch3,ch0 input mux control input switches s/h + - s/h + - s/h + - an6 buffer result note 1: on devices with two adc modules, an0-an15 can be read by either adc1, adc2 or both adcs. 2: v ref +, v ref - inputs may be multiplexed with other analog inputs. see device data sheet for details. 3: channels 1, 2 and 3 are not applicable for the 12-bit mode of operation.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 234 ? 2007 microchip technology inc. equation 20-1: adc conversion clock period figure 20-3: adc transfer function (10-bit example) figure 20-4: adc conversion clock period block diagram t ad = t cy (adcs + 1) adcs = t ad t cy ? 1 10 0000 0010 (= 514) 10 0000 0011 (= 515) 01 1111 1101 (= 509) 01 1111 1110 (= 510) 01 1111 1111 (= 511) 11 1111 1110 (= 1022) 11 1111 1111 (= 1023) 00 0000 0000 (= 0) 00 0000 0001 (= 1) output code 10 0000 0000 (= 512) (v inh ? v inl ) v refl v refh ? v refl 1024 v refh v refl + 10 0000 0001 (= 513) 512 * (v refh ? v refl ) 1024 v refl + 1023 * (v refh ? v refl ) 1024 v refl + 0 1 adc internal rc clock t osc (1) x 2 adc conversion clock multiplier 1, 2, 3, 4, 5,..., 64 adxcon3<15> t cy t ad 6 adxcon3<5:0> note: refer to figure 8-2 for the derivation of f osc when the pll is enabled. if the pll is not used, f osc is equal to the clock source frequency. t osc = 1/f osc .
? 2007 microchip technology inc. ds70286a-page 235 dspic33fjxxxgpx06/x08/x10 register 20-1: adxcon1: adcx control register 1 (where x = 1 or 2) r/w-0 u-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 adon ? adsidl addmabm ?ad12b form<1:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 hc,hs r/c-0 hc, hs ssrc<2:0> ? simsam asam samp done bit 7 bit 0 legend: hc = cleared by hardware hs = set by hardware r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 adon: adc operating mode bit 1 = adc module is operating 0 =adc is off bit 14 unimplemented: read as ? 0 ? bit 13 adsidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12 addmabm: dma buffer build mode bit 1 = dma buffers are written in the order of conversion. the module will provide an address to the dma channel that is the same as the address used for the non-dma stand-alone buffer. 0 = dma buffers are written in scatter/gather mode. the module will provide a scatter/gather address to the dma channel, based on the index of the analog input and the size of the dma buffer. bit 11 unimplemented: read as ? 0 ? bit 10 ad12b: 10-bit or 12-bit operation mode bit 1 = 12-bit, 1-channel adc operation 0 = 10-bit, 4-channel adc operation bit 9-8 form<1:0>: data output format bits for 10-bit operation: 11 = signed fractional (d out = sddd dddd dd00 0000 , where s = .not.d<9>) 10 = fractional (d out = dddd dddd dd00 0000 ) 01 = signed integer (d out = ssss sssd dddd dddd , where s = .not.d<9>) 00 = integer (d out = 0000 00dd dddd dddd ) for 12-bit operation: 11 = signed fractional (d out = sddd dddd dddd 0000 , where s = .not.d<11>) 10 = fractional (d out = dddd dddd dddd 0000 ) 01 = signed integer (d out = ssss sddd dddd dddd , where s = .not.d<11>) 00 = integer (d out = 0000 dddd dddd dddd ) bit 7-5 ssrc<2:0>: sample clock source select bits 111 = internal counter ends sampling and starts conversion (auto-convert) 110 = reserved 101 = reserved 100 = reserved 011 = mpwm interval ends sampling and starts conversion 010 = gp timer (timer3 for adc1, timer5 for adc2) compare ends sampling and starts conversion 001 = active transition on intx pin ends sampling and starts conversion 000 = clearing sample bit ends sampling and starts conversion bit 4 unimplemented: read as ? 0 ?
dspic33fjxxxgpx06/x08/x10 ds70286a-page 236 ? 2007 microchip technology inc. bit 3 simsam: simultaneous sample select bit (only applicable when chps<1:0> = 01 or 1x ) when ad12b = 1 , simsam is: u-0, unimplemented, read as ? 0 ? 1 = samples ch0, ch1, ch2, ch3 simultaneously (when chps<1:0> = 1x ); or samples ch0 and ch1 simultaneously (when chps<1:0> = 01 ) 0 = samples multiple channels individually in sequence bit 2 asam: adc sample auto-start bit 1 = sampling begins immediately after last conversion. samp bit is auto-set. 0 = sampling begins when samp bit is set bit 1 samp: adc sample enable bit 1 = adc sample/hold amplifiers are sampling 0 = adc sample/hold amplifiers are holding if asam = 0 , software may write ? 1 ? to begin sampling. automatically set by hardware if asam = 1 . if ssrc = 000 , software may write ? 0 ? to end sampling and start conversion. if ssrc 000 , automatically cleared by hardware to end sampling and start conversion. bit 0 done: adc conversion status bit 1 = adc conversion cycle is completed. 0 = adc conversion not started or in progress automatically set by hardware when adc conversion is complete. software may write ? 0 ? to clear done status (software not allowed to write ? 1 ?). clearing this bit will not affect any operation in progress. automatically cleared by hardware at start of a new conversion. register 20-1: adxcon1: adcx control register 1 (continued)(where x = 1 or 2)
? 2007 microchip technology inc. ds70286a-page 237 dspic33fjxxxgpx06/x08/x10 register 20-2: adxcon2: adcx control register 2 (where x = 1 or 2) r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 vcfg<2:0> ? ? cscna chps<1:0> bit 15 bit 8 r-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 bufs ? smpi<3:0> bufm alts bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 vcfg<2:0>: converter voltage reference configuration bits bit 12-11 unimplemented: read as ? 0 ? bit 10 cscna: scan input selections for ch0+ during sample a bit 1 = scan inputs 0 = do not scan inputs bit 9-8 chps<1:0>: selects channels utilized bits when ad12b = 1 , chps<1:0> is: u-0, unimplemented, read as ? 0 ? 1x = converts ch0, ch1, ch2 and ch3 01 = converts ch0 and ch1 00 = converts ch0 bit 7 bufs: buffer fill status bit (only valid when bufm = 1 ) 1 = adc is currently filling second half of buffer, user should access data in first half 0 = adc is currently filling first half of buffer, user should access data in second half bit 6 unimplemented: read as ? 0 ? bit 5-2 smpi<3:0>: selects increment rate for dma addresses bits or number of sample/conversion operations per interrupt. 1111 = increments the dma address or generates interrupt after completion of every 16th sample/conversion operation 1110 = increments the dma address or generates interrupt after completion of every 15th sample/conversion operation ? ? ? 0001 = increments the dma address or generates interrupt after completion of every 2nd sample/conversion operation 0000 = increments the dma address or generates interrupt after completion of every sample/conversion operation bit 1 bufm: buffer fill mode select bit 1 = starts filling first half of buffer on first interrupt and second half of the buffer on next interrupt 0 = always starts filling buffer from the beginning bit 0 alts: alternate input sample mode select bit 1 = uses channel input selects for sample a on first sample and sample b on next sample 0 = always uses channel input selects for sample a adref+ adref- 000 a vdd a vss 001 external v ref +a vss 010 a vdd external v ref - 011 external v ref + external v ref - 1xx a vdd avss
dspic33fjxxxgpx06/x08/x10 ds70286a-page 238 ? 2007 microchip technology inc. register 20-3: adxcon3: adcx control register 3 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adrc ? ? samc<4:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?adcs<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 adrc: adc conversion clock source bit 1 = adc internal rc clock 0 = clock derived from system clock bit 14-13 unimplemented: read as ? 0 ? bit 12-8 samc<4:0>: auto sample time bits 11111 = 31 t ad ? ? ? 00001 = 1 t ad 00000 = 0 t ad bit 7-6 unimplemented: read as ? 0 ? bit 5-0 adcs<5:0>: adc conversion clock select bits 111111 = t cy (adcs<7:0> + 1) = 64 t cy = t ad ? ? ? 000010 = t cy (adcs<7:0> + 1) = 3 t cy = t ad 000001 = t cy (adcs<7:0> + 1) = 2 t cy = t ad 000000 = t cy (adcs<7:0> + 1) = 1 t cy = t ad
? 2007 microchip technology inc. ds70286a-page 239 dspic33fjxxxgpx06/x08/x10 register 20-4: adxcon4: adcx control register 4 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? dmabl<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-3 unimplemented: read as ? 0 ? bit 2-0 dmabl<2:0>: selects number of dma buffer locations per analog input bits 111 = allocates 128 words of buffer to each analog input 110 = allocates 64 words of buffer to each analog input 101 = allocates 32 words of buffer to each analog input 100 = allocates 16 words of buffer to each analog input 011 = allocates 8 words of buffer to each analog input 010 = allocates 4 words of buffer to each analog input 001 = allocates 2 words of buffer to each analog input 000 = allocates 1 word of buffer to each analog input
dspic33fjxxxgpx06/x08/x10 ds70286a-page 240 ? 2007 microchip technology inc. register 20-5: adxchs123: adcx input channel 1, 2, 3 select register u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? ch123nb<1:0> ch123sb bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? ch123na<1:0> ch123sa bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10-9 ch123nb<1:0>: channel 1, 2, 3 negative input select for sample b bits when ad12b = 1 , chxnb is: u-0, unimplemented, read as ? 0 ? 11 = ch1 negative input is an9, ch2 negative input is an10, ch3 negative input is an11 10 = ch1 negative input is an6, ch2 negative input is an7, ch3 negative input is an8 0x = ch1, ch2, ch3 negative input is v ref - bit 8 ch123sb: channel 1, 2, 3 positive input select for sample b bit when ad12b = 1 , chxsa is: u-0, unimplemented, read as ? 0 ? 1 = ch1 positive input is an3, ch2 positive input is an4, ch3 positive input is an5 0 = ch1 positive input is an0, ch2 positive input is an1, ch3 positive input is an2 bit 7-3 unimplemented: read as ? 0 ? bit 2-1 ch123na<1:0>: channel 1, 2, 3 negative input select for sample a bits when ad12b = 1 , chxna is: u-0, unimplemented, read as ? 0 ? 11 = ch1 negative input is an9, ch2 negative input is an10, ch3 negative input is an11 10 = ch1 negative input is an6, ch2 negative input is an7, ch3 negative input is an8 0x = ch1, ch2, ch3 negative input is v ref - bit 0 ch123sa: channel 1, 2, 3 positive input select for sample a bit when ad12b = 1 , chxsa is: u-0, unimplemented, read as ? 0 ? 1 = ch1 positive input is an3, ch2 positive input is an4, ch3 positive input is an5 0 = ch1 positive input is an0, ch2 positive input is an1, ch3 positive input is an2
? 2007 microchip technology inc. ds70286a-page 241 dspic33fjxxxgpx06/x08/x10 register 20-6: adxchs0: adcx input channel 0 select register r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ch0nb ? ? ch0sb<4:0> bit 15 bit 8 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ch0na ? ? ch0sa<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ch0nb: channel 0 negative input select for sample b bit same definition as bit 7. bit 14-13 unimplemented: read as ? 0 ? bit 12-8 ch0sb<4:0>: channel 0 positive input select for sample b bits same definition as bit<4:0>. bit 7 ch0na: channel 0 negative input select for sample a bit 1 = channel 0 negative input is an1 0 = channel 0 negative input is v ref - bit 6-5 unimplemented: read as ? 0 ? bit 4-0 ch0sa<4:0>: channel 0 positive input select for sample a bits 11111 = channel 0 positive input is an31 11110 = channel 0 positive input is an30 ? ? ? 00010 = channel 0 positive input is an2 00001 = channel 0 positive input is an1 00000 = channel 0 positive input is an0
dspic33fjxxxgpx06/x08/x10 ds70286a-page 242 ? 2007 microchip technology inc. register 20-7: adxcssh: adcx input scan select register high (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 css31 css30 css29 css28 c ss27 css26 css25 css24 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 css23 css22 css21 css20 c ss19 css18 css17 css16 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 css<31:16>: adc input scan selection bits 1 = select anx for input scan 0 = skip anx for input scan note 1: on devices without 32 analog inputs, all adxcssl bits may be selected by user. however, inputs selected for scan without a corresponding input on device will convert adref-. register 20-8: adxcssl: adcx input scan select register low (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 css15 css14 css13 css12 css11 css10 css9 css8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 css7 css6 css5 css4 css3 css2 css1 css0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 css<15:0>: adc input scan selection bits 1 = select anx for input scan 0 = skip anx for input scan note 1: on devices without 16 analog inputs, all adxcssl bits may be selected by user. however, inputs selected for scan without a corresponding input on device will convert adref-.
? 2007 microchip technology inc. ds70286a-page 243 dspic33fjxxxgpx06/x08/x10 register 20-9: ad1pcfgh: adc1 port configuration register high (1,2) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pcfg31 pcfg30 pcfg 29 pcfg28 pcfg27 pc fg26 pcfg25 pcfg24 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pcfg23 pcfg22 pcfg 21 pcfg20 pcfg19 pc fg18 pcfg17 pcfg16 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 pcfg<31:16>: adc port configuration control bits 1 = port pin in digital mode, port read input enabled, adc input multiplexor connected to av ss 0 = port pin in analog mode, port read input disabled, adc samples pin voltage note 1: on devices without 32 analog inputs, all pcfg bits are r/w by user. however, pcfg bits are ignored on ports without a corresponding input on device. 2: adc2 only supports analog inputs an0-an15; therefore, no adc2 port configuration register exists. register 20-10: adxpcfgl: adcx po rt configuration register low (1,2) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pcfg15 pcfg14 pcfg 13 pcfg12 pcfg11 pc fg10 pcfg9 pcfg8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pcfg7 pcfg6 pcfg5 pcfg4 pcfg3 pcfg2 pcfg1 pcfg0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 pcfg<15:0>: adc port configuration control bits 1 = port pin in digital mode, port read input enabled, adc input multiplexor connected to av ss 0 = port pin in analog mode, port read input disabled, adc samples pin voltage note 1: on devices without 16 analog inputs, all pcfg bits are r/w by user. however, pcfg bits are ignored on ports without a corresponding input on device. 2: on devices with two analog-to-digital modules, both ad1pcfgl and ad2pcfgl will affect the configuration of port pins multiplexed with an0-an15.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 244 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 245 dspic33fjxxxgpx06/x08/x10 21.0 special features dspic33fjxxxgpx06/x08/x10 devices include sev- eral features intended to maximize application flexibility and reliability, and minimize cost through elimination of external components. these are: ? flexible configuration ? watchdog timer (wdt) ? code protection and codeguard? security ? jtag boundary scan interface ? in-circuit serial programming? (icsp?) ? in-circuit emulation 21.1 configuration bits the configuration bits can be programmed (read as ? 0 ?), or left unprogrammed (read as ? 1 ?), to select various device configurations. these bits are mapped starting at program memory location 0xf80000. the device configuration register map is shown in table 21-1. the individual configuration bit descriptions for the fbs, fss, fgs, foscsel, fosc, fwdt, fpor and ficd configuration registers are shown in table 21-2. note that address 0xf80000 is beyond the user program memory space. in fact, it belongs to the configuration memory space (0x800000-0xffffff) which can only be accessed using table reads and table writes. the upper byte of all device configuration registers should always be ? 1111 1111 ?. this makes them appear to be nop instructions in the remote event that their locations are ever executed by accident. since configuration bits are not implemented in the corresponding locations, writing ? 1 ?s to these locations has no effect on device operation. to prevent inadvertent configuration changes during code execution, all programmable configuration bits are write-once. after a bit is initially programmed during a power cycle, it cannot be written to again. changing a device configuration requires that power to the device be cycled. table 21-1: device conf iguration register map note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections. address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 0xf80000 fbs rbs<1:0> ? ? bss<2:0> bwrp 0xf80002 fss rss<1:0> ? ? sss<2:0> swrp 0xf80004 fgs ? ? ? ? ? gss1 gss0 gwrp 0xf80006 foscsel ieso ? ? ? ?fnosc<2:0> 0xf80008 fosc fcksm<1:0> ? ? ? osciofnc poscmd<1:0> 0xf8000a fwdt fwdten windis ? wdtpre wdtpost<3:0> 0xf8000c fpor ? ? ? ? ?fpwrt<2:0> 0xf8000e reserved3 reserved (1) 0xf80010 fuid0 user unit id byte 0 0xf80012 fuid1 user unit id byte 1 0xf80014 fuid2 user unit id byte 2 0xf80016 fuid3 user unit id byte 3 note 1: these reserved bits read as ? 1 ? and must be programmed as ? 1 ?. 2: unimplemented bits are read as ? 0 ?.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 246 ? 2007 microchip technology inc. table 21-2: dspic33fjxxxgpx06/x08/x1 0 configuration bi ts description bit field register description bwrp fbs boot segment program flash write protection 1 = boot segment may be written 0 = boot segment is write-protected bss<2:0> fbs boot segment program flash code protection size x11 = no boot program flash segment boot space is 1k iw less vs 110 = standard security; boot program flash segment starts at end of vs, ends at 0007feh 010 = high security; boot program flash segment starts at end of vs, ends at 0007feh boot space is 4k iw less vs 101 = standard security; boot program flash segment starts at end of vs, ends at 001ffeh 001 = high security; boot program flash segment starts at end of vs, ends at 001ffeh boot space is 8k iw less vs 100 = standard security; boot program flash segment starts at end of vs, ends at 003ffeh 000 = high security; boot program flash segment starts at end of vs, ends at 003ffeh rbs<1:0> fbs boot segment ram code protection 10 = no boot ram defined 10 = boot ram is 128 bytes 01 = boot ram is 256 bytes 00 = boot ram is 1024 bytes swrp fss secure segment program flash write protection 1 = secure segment may be written 0 = secure segment is write-protected.
? 2007 microchip technology inc. ds70286a-page 247 dspic33fjxxxgpx06/x08/x10 sss<2:0> fss secure segment program flash code protection size (for 128k and 256k devices) x11 = no secure program flash segment secure space is 8k iw less bs 110 = standard security; secure program flash segment starts at end of bs, ends at 0x003ffe 010 = high security; secure program flash segment starts at end of bs, ends at 0x003ffe secure space is 16k iw less bs 101 = standard security; secure program flash segment starts at end of bs, ends at 0x007ffe 001 = high security; secure program flash segment starts at end of bs, ends at 0x007ffe secure space is 32k iw less bs 100 = standard security; secure program flash segment starts at end of bs, ends at 0x00fffe 000 = high security; secure program flash segment starts at end of bs, ends at 0x00fffe (for 64k devices) x11 = no secure program flash segment secure space is 4k iw less bs 110 = standard security; secure program flash segment starts at end of bs, ends at 0x001ffe 010 = high security; secure program flash segment starts at end of bs, ends at 0x001ffe secure space is 8k iw less bs 101 = standard security; secure program flash segment starts at end of bs, ends at 0x003ffe 001 = high security; secure program flash segment starts at end of bs, ends at 0x003ffe secure space is 16k iw less bs 100 = standard security; secure program flash segment starts at end of bs, ends at 007ffeh 000 = high security; secure program flash segment starts at end of bs, ends at 0x007ffe rss<1:0> fss secure segment ram code protection 10 = no secure ram defined 10 = secure ram is 256 bytes less bs ram 01 = secure ram is 2048 bytes less bs ram 00 = secure ram is 4096 bytes less bs ram gss<1:0> fgs general segment code-protect bit 11 = user program memory is not code-protected 10 = standard security; general program flash segment starts at end of ss, ends at eom 0x = high security; general program flash segment starts at end of ss, ends at eom gwrp fgs general segment write-protect bit 1 = user program memory is not write-protected 0 = user program memory is write-protected table 21-2: dspic33fjxxxgpx06/x08/x10 conf iguration bits description (continued) bit field register description
dspic33fjxxxgpx06/x08/x10 ds70286a-page 248 ? 2007 microchip technology inc. 21.2 on-chip voltage regulator all of the dspic33fjxxxgpx06/x08/x10 devices power their core digital logic at a nominal 2.5v. this may create an issue for designs that are required to operate at a higher typical voltage, such as 3.3v. to simplify system design, all devices in the ieso foscsel two-speed oscillator start-up enable bit 1 = start-up device with frc, then automatically switch to the user-selected oscillator source when ready. 0 = start-up device with user-selected oscillator source fnosc<2:0> foscsel initial oscillator source selection bits 111 = internal fast rc (frc) oscillator with postscaler 110 = internal fast rc (frc) oscillator with divide-by-16 101 = lprc oscillator 100 = secondary (lp) oscillator 011 = primary (xt, hs, ec) oscillator with pll 010 = primary (xt, hs, ec) oscillator 001 = internal fast rc (frc) oscillator with pll 000 = frc oscillator fcksm<1:0> fosc clock switching mode bits 1x = clock switching is disabled, fail-safe clock monitor is disabled 01 = clock switching is enabled, fail-safe clock monitor is disabled 00 = clock switching is enabled, fail-safe clock monitor is enabled osciofnc fosc osc2 pin function bit (except in xt and hs modes) 1 = osc2 is clock output 0 = osc2 is general purpose digital i/o pin poscmd<1:0> fosc primary oscillator mode select bits 11 = primary oscillator disabled 10 = hs crystal oscillator mode 01 = xt crystal oscillator mode 00 = ec (external clock) mode fwdten fwdt watchdog timer enable bit 1 = watchdog timer always enabled (lprc oscillator cannot be disabled. clearing the swdten bit in the rcon register will have no effect.) 0 = watchdog timer enabled/disabled by user software (lprc can be disabled by clearing the swdten bit in the rcon register) windis fwdt watchdog timer window enable bit 1 = watchdog timer in non-window mode 0 = watchdog timer in window mode wdtpre fwdt watchdog timer prescaler bit 1 = 1:128 0 = 1:32 wdtpost fwdt watchdog timer postscaler bits 1111 = 1:32,768 1110 = 1:16,384 . . . 0001 = 1:2 0000 = 1:1 reserved reserved3, fpor reserved (either read as ? 1 ? and write as ? 1 ?, or read as ? 0 ? and write as ? 0 ?) ?fgs, fosc- sel, fosc, fwdt, fpor unimplemented (read as ? 0 ?, write as ? 0 ?) table 21-2: dspic33fjxxxgpx06/x08/x10 conf iguration bits description (continued) bit field register description
? 2007 microchip technology inc. ds70286a-page 249 dspic33fjxxxgpx06/x08/x10 dspic33fjxxxgpx06/x08/x10 family incorporate an on-chip regulator that allows the device to run its core logic from v dd . the regulator provides power to the core from the other v dd pins. the regulator requires that a low-esr (less than 5 ohms) capacitor (such as tantalum or ceramic) be connected to the v ddcore /v cap pin (figure 21-1). this helps to maintain the stability of the regulator. the recommended value for the filter capacitor is provided in table 24-13: ?internal voltage regulator speci- fications? located in section 24.1 ?dc characteris- tics? . on a por , it takes approximately 20 s for the on-chip voltage regulator to generate an output voltage. during this time, designated as t startup , code execution is disabled. t startup is applied every time the device resumes operation after any power-down. figure 21-1: conne ctions for the on-chip voltage regulator (1) 21.3 bor: brown-out reset the bor (brown-out reset) module is based on an internal voltage reference circuit that monitors the regulated voltage v ddcore . the main purpose of the bor module is to generate a device reset when a brown-out condition occurs. brown-out conditions are generally caused by glitches on the ac mains (i.e., missing portions of the ac cycle waveform due to bad power transmission lines or voltage sags due to excessive current draw when a large inductive load is turned on). a bor will generate a reset pulse which will reset the device. the bor will select the clock source, based on the device configuration bit values (fnosc<2:0> and poscmd<1:0>). furthermore, if an oscillator mode is selected, the bor will activate the oscillator start-up timer (ost). the system clock is held until ost expires. if the pll is used, then the clock will be held until the lock bit (osccon<5>) is ?1?. concurrently, the pwrt time-out (tpwrt) will be applied before the internal reset is released. if tpwrt = 0 and a crystal oscillator is being used, then a nomi- nal delay of tfscm = 100 is applied. the total delay in this case is tfscm. the bor status bit (rcon<1>) will be set to indicate that a bor has occurred. the bor circuit, if enabled, continues to operate while in sleep or idle modes and will reset the device should vdd fall below the bor threshold voltage. note 1: these are typical operating voltages. refer to table 24-13: ?internal voltage regu- lator specifications? located in section 24.1 ?dc characteristics? for the full operating ranges of v dd and v ddcore . v dd v ddcore /v cap v ss dspic33f c f 3.3v
dspic33fjxxxgpx06/x08/x10 ds70286a-page 250 ? 2007 microchip technology inc. 21.4 watchdog timer (wdt) for dspic33fjxxxgpx06/x08/x10 devices, the wdt is driven by the lprc oscillator. when the wdt is enabled, the clock source is also enabled. the nominal wdt clock source from lprc is 32 khz. this feeds a prescaler than can be configured for either 5-bit (divide-by-32) or 7-bit (divide-by-128) operation. the prescaler is set by the wdtpre configuration bit. with a 32 khz input, the prescaler yields a nominal wdt time-out period (t wdt ) of 1 ms in 5-bit mode, or 4 ms in 7-bit mode. a variable postscaler divides down the wdt prescaler output and allows for a wide range of time-out periods. the postscaler is controlled by the wdtpost<3:0> configuration bits (fwdt<3:0>) which allow the selec- tion of a total of 16 settings, from 1:1 to 1:32,768. using the prescaler and postscaler, time-out periods ranging from 1 ms to 131 seconds can be achieved. the wdt, prescaler and postscaler are reset: ? on any device reset ? on the completion of a clock switch, whether invoked by software (i.e., setting the oswen bit after changing the nosc bits) or by hardware (i.e., fail-safe clock monitor) ? when a pwrsav instruction is executed (i.e., sleep or idle mode is entered) ? when the device exits sleep or idle mode to resume normal operation ?by a clrwdt instruction during normal execution if the wdt is enabled, it will continue to run during sleep or idle modes. when the wdt time-out occurs, the device will wake the device and code execution will continue from where the pwrsav instruction was executed. the corresponding sleep or idle bits (rcon<3,2>) will need to be cleared in software after the device wakes up. the wdt flag bit, wdto (rcon<4>), is not automatically cleared following a wdt time-out. to detect subsequent wdt events, the flag must be cleared in software. the wdt is enabled or disabled by the fwdten configuration bit in the fwdt configuration register. when the fwdten configuration bit is set, the wdt is always enabled. the wdt can be optionally controlled in software when the fwdten configuration bit has been programmed to ? 0 ?. the wdt is enabled in software by setting the swdten control bit (rcon<5>). the swdten control bit is cleared on any device reset. the software wdt option allows the user to enable the wdt for critical code segments and disable the wdt during non-critical segments for maximum power savings. figure 21-2: wdt block diagram note: the clrwdt and pwrsav instructions clear the prescaler and postscaler counts when executed. note: if the windis bit (fwdt<6>) is cleared, the clrwdt instruction should be executed by the application software only during the last 1/4 of the wdt period. this clrwdt window can be determined by using a timer. if a clrwdt instruction is executed before this window, a wdt reset occurs. all device resets transition to new clock source exit sleep or idle mode pwrsav instruction clrwdt instruction 0 1 wdtpre wdtpost<3:0> watchdog timer prescaler (divide by n1) postscaler (divide by n2) sleep/idle wdt wdt window select windis wdt clrwdt instruction swdten fwdten lprc clock rs rs wake-up reset
? 2007 microchip technology inc. ds70286a-page 251 dspic33fjxxxgpx06/x08/x10 21.5 jtag interface dspic33fjxxxgpx06/x08/x10 devices implement a jtag interface, which supports boundary scan device testing, as well as in-circuit programming. detailed information on the interface will be provided in future revisions of the document. 21.6 code protection and codeguard? security the dspic33f product families offer the advanced implementation of codeguard? security. codeguard security enables multiple parties to securely share resources (memory, interrupts and peripherals) on a single chip. this feature helps protect individual intellectual property in collaborative system designs. when coupled with software encryption libraries, codeguard? security can be used to securely update flash even when multiple ip are resident on the single chip. the code protection features vary depending on the actual dspic33f implemented. the following sections provide an overview of these features. the code protection features are controlled by the configuration registers: fbs, fss and fgs. 21.7 in-circuit serial programming dspic33fjxxxgpx06/x08/x10 family digital signal controllers can be serially programmed while in the end application circuit. this is simply done with two lines for clock and data and three other lines for power, ground and the programming sequence. this allows custom- ers to manufacture boards with unprogrammed devices and then program the digital signal controller just before shipping the product. this also allows the most recent firmware or a custom firmware, to be pro- grammed. please refer to the ? dspic33f/pic24h flash programming specification? (ds70152) docu- ment for details about icsp. any 1 out of 3 pairs of programming clock/data pins may be used: ? pgc1/emuc1 and pgd1/emud1 ? pgc2/emuc2 and pgd2/emud2 ? pgc3/emuc3 and pgd3/emud3 21.8 in-circuit debugger when mplab ? icd 2 is selected as a debugger, the in-circuit debugging functionality is enabled. this function allows simple debugging functions when used with mplab ide. debugging functionality is controlled through the emucx (emulation/debug clock) and emudx (emulation/debug data) pin functions. any 1 out of 3 pairs of debugging clock/data pins may be used: ? pgc1/emuc1 and pgd1/emud1 ? pgc2/emuc2 and pgd2/emud2 ? pgc3/emuc3 and pgd3/emud3 to use the in-circuit debugger function of the device, the design must implement icsp connections to mclr , v dd , v ss , pgc, pgd and the emudx/emucx pin pair. in addition, when the feature is enabled, some of the resources are not available for general use. these resources include the first 80 bytes of data ram and two i/o pins. note: refer to ?codeguard security reference manual ? (ds70180) for further information on usage, configuration and operation of codeguard security.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 252 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 253 dspic33fjxxxgpx06/x08/x10 22.0 instruction set summary the dspic33f instruction set is identical to that of the dspic30f. most instructions are a single program memory word (24 bits). only three instructions require two program memory locations. each single-word instruction is a 24-bit word, divided into an 8-bit opcode, which specifies the instruction type and one or more operands, which further specify the operation of the instruction. the instruction set is highly orthogonal and is grouped into five basic categories: ? word or byte-oriented operations ? bit-oriented operations ? literal operations ? dsp operations ? control operations table 22-1 shows the general symbols used in describing the instructions. the dspic33f instruction set summary in table 22-2 lists all the instructions, along with the status flags affected by each instruction. most word or byte-oriented w register instructions (including barrel shift instructions) have three operands: ? the first source operand which is typically a register ?wb? without any address modifier ? the second source operand which is typically a register ?ws? with or without an address modifier ? the destination of the result which is typically a register ?wd? with or without an address modifier however, word or byte-oriented file register instruc- tions have two operands: ? the file register specified by the value ?f? ? the destination, which could either be the file register ?f? or the w0 register, which is denoted as ?wreg? most bit-oriented instructions (including simple rotate/ shift instructions) have two operands: ? the w register (with or without an address modifier) or file register (specified by the value of ?ws? or ?f?) ? the bit in the w register or file register (specified by a literal value or indirectly by the contents of register ?wb?) the literal instructions that involve data movement may use some of the following operands: ? a literal value to be loaded into a w register or file register (specified by the value of ?k?) ? the w register or file register where the literal value is to be loaded (specified by ?wb? or ?f?) however, literal instructions that involve arithmetic or logical operations use some of the following operands: ? the first source operand which is a register ?wb? without any address modifier ? the second source operand which is a literal value ? the destination of the result (only if not the same as the first source operand) which is typically a register ?wd? with or without an address modifier the mac class of dsp instructions may use some of the following operands: ? the accumulator (a or b) to be used (required operand) ? the w registers to be used as the two operands ? the x and y address space prefetch operations ? the x and y address space prefetch destinations ? the accumulator write back destination the other dsp instructions do not involve any multiplication and may include: ? the accumulator to be used (required) ? the source or destination operand (designated as wso or wdo, respectively) with or without an address modifier ? the amount of shift specified by a w register ?wn? or a literal value the control instructions may use some of the following operands: ? a program memory address ? the mode of the table read and table write instructions note: this data sheet summarizes the features of this group of dspic33fjxxxgpx06/ x08/x10 devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the ?dspic33f family reference manual? . please refer to the microchip web site (www.microchip.com) for the latest dspic33f family reference manual sections.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 254 ? 2007 microchip technology inc. all instructions are a single word, except for certain double-word instructions, which were made double- word instructions so that all the required information is available in these 48 bits. in the second word, the 8msbs are ? 0 ?s. if this second word is executed as an instruction (by itself), it will execute as a nop . most single-word instructions are executed in a single instruction cycle, unless a conditional test is true, or the program counter is changed as a result of the instruc- tion. in these cases, the execution takes two instruction cycles with the additional instruction cycle(s) executed as a nop . notable exceptions are the bra (uncondi- tional/computed branch), indirect call/goto , all table reads and writes and return/retfie instructions, which are single-word instructions but take two or three cycles. certain instructions that involve skipping over the subsequent instruction require either two or three cycles if the skip is performed, depending on whether the instruction being skipped is a single-word or two-word instruction. moreover, double-word moves require two cycles. the double-word instructions execute in two instruction cycles. note: for more details on the instruction set, refer to the ?dspic30f/33f programmer?s reference manual? (ds70157). table 22-1: symbols used in opcode descriptions field description #text means literal defined by ? text ? (text) means ?content of text ? [text] means ?the location addressed by text ? { } optional field or operation register bit field .b byte mode selection .d double-word mode selection .s shadow register select .w word mode selection (default) acc one of two accumulators {a, b} awb accumulator write back destination address register {w13, [w13]+ = 2} bit4 4-bit bit selection field (used in word addressed instructions) {0...15} c, dc, n, ov, z mcu status bits: carry, digit carry, negative, overflow, sticky zero expr absolute address, label or expression (resolved by the linker) f file register address {0x0000...0x1fff} lit1 1-bit unsigned literal {0,1} lit4 4-bit unsigned literal {0...15} lit5 5-bit unsigned literal {0...31} lit8 8-bit unsigned literal {0...255} lit10 10-bit unsigned literal {0...255} for byte mode, {0:1023} for word mode lit14 14-bit unsigned literal {0...16384} lit16 16-bit unsigned literal {0...65535} lit23 23-bit unsigned literal {0...8388608}; lsb must be ? 0 ? none field does not require an entry, may be blank oa, ob, sa, sb dsp status bits: acca overflow, accb overflow, acca saturate, accb saturate pc program counter slit10 10-bit signed literal {-512...511} slit16 16-bit signed literal {-32768...32767} slit6 6-bit signed literal {-16...16} wb base w register {w0..w15} wd destination w register { wd, [wd], [wd++], [wd--], [++wd], [--wd] } wdo destination w register { wnd, [wnd], [wnd++], [wnd--], [++wnd], [--wnd], [wnd+wb] } wm,wn dividend, divisor working r egister pair (direct addressing)
? 2007 microchip technology inc. ds70286a-page 255 dspic33fjxxxgpx06/x08/x10 wm*wm multiplicand and multiplier working register pair for square instructions {w4 * w4,w5 * w5,w6 * w6,w7 * w7} wm*wn multiplicand and multiplier working register pair for dsp instructions {w4 * w5,w4 * w6,w4 * w7,w5 * w6,w5 * w7,w6 * w7} wn one of 16 working registers {w0..w15} wnd one of 16 destination working registers {w0..w15} wns one of 16 source working registers {w0..w15} wreg w0 (working register used in file register instructions) ws source w register { ws, [ws], [ws++], [ws--], [++ws], [--ws] } wso source w register { wns, [wns], [wns++], [wns--], [++wns], [--wns], [wns+wb] } wx x data space prefetch address register for dsp instructions {[w8]+ = 6, [w8]+ = 4, [w8]+ = 2, [w8], [w8]- = 6, [w8]- = 4, [w8]- = 2, [w9]+ = 6, [w9]+ = 4, [w9]+ = 2, [w9], [w9]- = 6, [w9]- = 4, [w9]- = 2, [w9 + w12], none} wxd x data space prefetch destination register for dsp instructions {w4..w7} wy y data space prefetch address register for dsp instructions {[w10]+ = 6, [w10]+ = 4, [w10]+ = 2, [w10], [w10]- = 6, [w10]- = 4, [w10]- = 2, [w11]+ = 6, [w11]+ = 4, [w11]+ = 2, [w11], [w11]- = 6, [w11]- = 4, [w11]- = 2, [w11 + w12], none} wyd y data space prefetch destination register for dsp instructions {w4..w7} table 22-1: symbols used in opcode descriptions (continued) field description
dspic33fjxxxgpx06/x08/x10 ds70286a-page 256 ? 2007 microchip technology inc. table 22-2: instruction set overview base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected 1 add add acc add accumulators 1 1 oa,ob,sa,sb add f f = f + wreg 1 1 c,dc,n,ov,z add f,wreg wreg = f + wreg 1 1 c,dc,n,ov,z add #lit10,wn wd = lit10 + wd 1 1 c,dc,n,ov,z add wb,ws,wd wd = wb + ws 1 1 c,dc,n,ov,z add wb,#lit5,wd wd = wb + lit5 1 1 c,dc,n,ov,z add wso,#slit4,acc 16-bit signed add to accumulator 1 1 oa,ob,sa,sb 2 addc addc f f = f + wreg + (c) 1 1 c,dc,n,ov,z addc f,wreg wreg = f + wreg + (c) 1 1 c,dc,n,ov,z addc #lit10,wn wd = lit10 + wd + (c) 1 1 c,dc,n,ov,z addc wb,ws,wd wd = wb + ws + (c) 1 1 c,dc,n,ov,z addc wb,#lit5,wd wd = wb + lit5 + (c) 1 1 c,dc,n,ov,z 3 and and f f = f .and. wreg 1 1 n,z and f,wreg wreg = f .and. wreg 1 1 n,z and #lit10,wn wd = lit10 .and. wd 1 1 n,z and wb,ws,wd wd = wb .and. ws 1 1 n,z and wb,#lit5,wd wd = wb .and. lit5 1 1 n,z 4 asr asr f f = arithmetic right shift f 1 1 c,n,ov,z asr f,wreg wreg = arithmetic right shift f 1 1 c,n,ov,z asr ws,wd wd = arithmetic right shift ws 1 1 c,n,ov,z asr wb,wns,wnd wnd = arithmetic right shift wb by wns 1 1 n,z asr wb,#lit5,wnd wnd = arithmetic right shift wb by lit5 1 1 n,z 5 bclr bclr f,#bit4 bit clear f 1 1 none bclr ws,#bit4 bit clear ws 1 1 none 6 bra bra c,expr branch if carry 1 1 (2) none bra ge,expr branch if greater than or equal 1 1 (2) none bra geu,expr branch if unsigned greater than or equal 1 1 (2) none bra gt,expr branch if greater than 1 1 (2) none bra gtu,expr branch if unsigned greater than 1 1 (2) none bra le,expr branch if less than or equal 1 1 (2) none bra leu,expr branch if unsigned less than or equal 1 1 (2) none bra lt,expr branch if less than 1 1 (2) none bra ltu,expr branch if unsigned less than 1 1 (2) none bra n,expr branch if negative 1 1 (2) none bra nc,expr branch if not carry 1 1 (2) none bra nn,expr branch if not negative 1 1 (2) none bra nov,expr branch if not overflow 1 1 (2) none bra nz,expr branch if not zero 1 1 (2) none bra oa,expr branch if accumulator a overflow 1 1 (2) none bra ob,expr branch if accumulator b overflow 1 1 (2) none bra ov,expr branch if overflow 1 1 (2) none bra sa,expr branch if accumulator a saturated 1 1 (2) none bra sb,expr branch if accumulator b saturated 1 1 (2) none bra expr branch unconditionally 1 2 none bra z,expr branch if zero 1 1 (2) none bra wn computed branch 1 2 none 7 bset bset f,#bit4 bit set f 1 1 none bset ws,#bit4 bit set ws 1 1 none 8 bsw bsw.c ws,wb write c bit to ws 1 1 none bsw.z ws,wb write z bit to ws 1 1 none 9 btg btg f,#bit4 bit toggle f 1 1 none btg ws,#bit4 bit toggle ws 1 1 none
? 2007 microchip technology inc. ds70286a-page 257 dspic33fjxxxgpx06/x08/x10 10 btsc btsc f,#bit4 bit test f, skip if clear 1 1 (2 or 3) none btsc ws,#bit4 bit test ws, skip if clear 1 1 (2 or 3) none 11 btss btss f,#bit4 bit test f, skip if set 1 1 (2 or 3) none btss ws,#bit4 bit test ws, skip if set 1 1 (2 or 3) none 12 btst btst f,#bit4 bit test f 1 1 z btst.c ws,#bit4 bit test ws to c 1 1 c btst.z ws,#bit4 bit test ws to z 1 1 z btst.c ws,wb bit test ws to c 1 1 c btst.z ws,wb bit test ws to z 1 1 z 13 btsts btsts f,#bit4 bit test then set f 1 1 z btsts.c ws,#bit4 bit test ws to c, then set 1 1 c btsts.z ws,#bit4 bit test ws to z, then set 1 1 z 14 call call lit23 call subroutine 2 2 none call wn call indirect subroutine 1 2 none 15 clr clr f f = 0x0000 1 1 none clr wreg wreg = 0x0000 1 1 none clr ws ws = 0x0000 1 1 none clr acc,wx,wxd,wy,wyd,awb clear accumulator 1 1 oa,ob,sa,sb 16 clrwdt clrwdt clear watchdog timer 1 1 wdto,sleep 17 com com f f = f 11 n,z com f,wreg wreg = f 11 n,z com ws,wd wd = ws 11 n,z 18 cp cp f compare f with wreg 1 1 c,dc,n,ov,z cp wb,#lit5 compare wb with lit5 1 1 c,dc,n,ov,z cp wb,ws compare wb with ws (wb ? ws) 1 1 c,dc,n,ov,z 19 cp0 cp0 f compare f with 0x0000 1 1 c,dc,n,ov,z cp0 ws compare ws with 0x0000 1 1 c,dc,n,ov,z 20 cpb cpb f compare f with wreg, with borrow 1 1 c,dc,n,ov,z cpb wb,#lit5 compare wb with lit5, with borrow 1 1 c,dc,n,ov,z cpb wb,ws compare wb with ws, with borrow (wb ? ws ? c ) 1 1 c,dc,n,ov,z 21 cpseq cpseq wb, wn compare wb with wn, skip if = 1 1 (2 or 3) none 22 cpsgt cpsgt wb, wn compare wb with wn, skip if > 1 1 (2 or 3) none 23 cpslt cpslt wb, wn compare wb with wn, skip if < 1 1 (2 or 3) none 24 cpsne cpsne wb, wn compare wb with wn, skip if 11 (2 or 3) none 25 daw daw wn wn = decimal adjust wn 1 1 c 26 dec dec f f = f ? 1 1 1 c,dc,n,ov,z dec f,wreg wreg = f ? 1 1 1 c,dc,n,ov,z dec ws,wd wd = ws ? 1 1 1 c,dc,n,ov,z 27 dec2 dec2 f f = f ? 2 1 1 c,dc,n,ov,z dec2 f,wreg wreg = f ? 2 1 1 c,dc,n,ov,z dec2 ws,wd wd = ws ? 2 1 1 c,dc,n,ov,z 28 disi disi #lit14 disable interrupts for k instruction cycles 1 1 none table 22-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected
dspic33fjxxxgpx06/x08/x10 ds70286a-page 258 ? 2007 microchip technology inc. 29 div div.s wm,wn signed 16/16-bit integer divide 1 18 n,z,c,ov div.sd wm,wn signed 32/16-bit integer divide 1 18 n,z,c,ov div.u wm,wn unsigned 16/16-bit integer divide 1 18 n,z,c,ov div.ud wm,wn unsigned 32/16-bit integer divide 1 18 n,z,c,ov 30 divf divf wm,wn signed 16/16-bit fractional divide 1 18 n,z,c,ov 31 do do #lit14,expr do code to pc + expr, lit14 + 1 times 2 2 none do wn,expr do code to pc + expr, (wn) + 1 times 2 2 none 32 ed ed wm*wm,acc,wx,wy,wxd euclidean distance (no accumulate) 1 1 oa,ob,oab, sa,sb,sab 33 edac edac wm*wm,acc,wx,wy,wxd euclidean distance 1 1 oa,ob,oab, sa,sb,sab 34 exch exch wns,wnd swap wns with wnd 1 1 none 35 fbcl fbcl ws,wnd find bit change from left (msb) side 1 1 c 36 ff1l ff1l ws,wnd find first one from left (msb) side 1 1 c 37 ff1r ff1r ws,wnd find first one from right (lsb) side 1 1 c 38 goto goto expr go to address 2 2 none goto wn go to indirect 1 2 none 39 inc inc f f = f + 1 1 1 c,dc,n,ov,z inc f,wreg wreg = f + 1 1 1 c,dc,n,ov,z inc ws,wd wd = ws + 1 1 1 c,dc,n,ov,z 40 inc2 inc2 f f = f + 2 1 1 c,dc,n,ov,z inc2 f,wreg wreg = f + 2 1 1 c,dc,n,ov,z inc2 ws,wd wd = ws + 2 1 1 c,dc,n,ov,z 41 ior ior f f = f .ior. wreg 1 1 n,z ior f,wreg wreg = f .ior. wreg 1 1 n,z ior #lit10,wn wd = lit10 .ior. wd 1 1 n,z ior wb,ws,wd wd = wb .ior. ws 1 1 n,z ior wb,#lit5,wd wd = wb .ior. lit5 1 1 n,z 42 lac lac wso,#slit4,acc load accumulator 1 1 oa,ob,oab, sa,sb,sab 43 lnk lnk #lit14 link frame pointer 1 1 none 44 lsr lsr f f = logical right shift f 1 1 c,n,ov,z lsr f,wreg wreg = logical right shift f 1 1 c,n,ov,z lsr ws,wd wd = logical right shift ws 1 1 c,n,ov,z lsr wb,wns,wnd wnd = logical right shift wb by wns 1 1 n,z lsr wb,#lit5,wnd wnd = logical right shift wb by lit5 1 1 n,z 45 mac mac wm*wn,acc,wx,wxd,wy,wyd , awb multiply and accumulate 1 1 oa,ob,oab, sa,sb,sab mac wm*wm,acc,wx,wxd,wy,wyd square and accumulate 1 1 oa,ob,oab, sa,sb,sab 46 mov mov f,wn move f to wn 1 1 none mov f move f to f 1 1 n,z mov f,wreg move f to wreg 1 1 n,z mov #lit16,wn move 16-bit literal to wn 1 1 none mov.b #lit8,wn move 8-bit literal to wn 1 1 none mov wn,f move wn to f 1 1 none mov wso,wdo move ws to wd 1 1 none mov wreg,f move wreg to f 1 1 n,z mov.d wns,wd move double from w(ns):w(ns + 1) to wd 1 2 none mov.d ws,wnd move double from ws to w(nd + 1):w(nd) 1 2 none 47 movsac movsac acc,wx,wxd,wy,wyd,awb prefetch and store accumulator 1 1 none table 22-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected
? 2007 microchip technology inc. ds70286a-page 259 dspic33fjxxxgpx06/x08/x10 48 mpy mpy wm*wn,acc,wx,wxd,wy,wyd multiply wm by wn to accumulator 1 1 oa,ob,oab, sa,sb,sab mpy wm*wm,acc,wx,wxd,wy,wyd square wm to accumulator 1 1 oa,ob,oab, sa,sb,sab 49 mpy.n mpy.n wm*wn,acc,wx,wxd,wy,wyd -(multiply wm by wn) to accumulator 1 1 none 50 msc msc wm*wm,acc,wx,wxd,wy,wyd , awb multiply and subtract from accumulator 1 1 oa,ob,oab, sa,sb,sab 51 mul mul.ss wb,ws,wnd {wnd + 1, wnd} = signed(wb) * signed(ws) 1 1 none mul.su wb,ws,wnd {wnd + 1, wnd} = signed(wb) * unsigned(ws) 1 1 none mul.us wb,ws,wnd {wnd + 1, wnd} = unsigned(wb) * signed(ws) 1 1 none mul.uu wb,ws,wnd {wnd + 1, wnd} = unsigned(wb) * unsigned(ws) 11 none mul.su wb,#lit5,wnd {wnd + 1, wnd} = signed(wb) * unsigned(lit5) 1 1 none mul.uu wb,#lit5,wnd {wnd + 1, wnd} = unsigned(wb) * unsigned(lit5) 11 none mul f w3:w2 = f * wreg 1 1 none 52 neg neg acc negate accumulator 1 1 oa,ob,oab, sa,sb,sab neg f f = f + 1 1 1 c,dc,n,ov,z neg f,wreg wreg = f + 1 1 1 c,dc,n,ov,z neg ws,wd wd = ws + 1 1 1 c,dc,n,ov,z 53 nop nop no operation 1 1 none nopr no operation 1 1 none 54 pop pop f pop f from top-of-stack (tos) 1 1 none pop wdo pop from top-of-stack (tos) to wdo 1 1 none pop.d wnd pop from top-of-stack (tos) to w(nd):w(nd + 1) 12 none pop.s pop shadow registers 1 1 all 55 push push f push f to top-of-stack (tos) 1 1 none push wso push wso to top-of-stack (tos) 1 1 none push.d wns push w(ns):w(ns + 1) to top-of-stack (tos) 12 none push.s push shadow registers 1 1 none 56 pwrsav pwrsav #lit1 go into sleep or idle mode 1 1 wdto,sleep 57 rcall rcall expr relative call 1 2 none rcall wn computed call 1 2 none 58 repeat repeat #lit14 repeat next instruction lit14 + 1 times 1 1 none repeat wn repeat next instruction (wn) + 1 times 1 1 none 59 reset reset software device reset 1 1 none 60 retfie retfie return from interrupt 1 3 (2) none 61 retlw retlw #lit10,wn return with literal in wn 1 3 (2) none 62 return return return from subroutine 1 3 (2) none 63 rlc rlc f f = rotate left through carry f 1 1 c,n,z rlc f,wreg wreg = rotate left through carry f 1 1 c,n,z rlc ws,wd wd = rotate left through carry ws 1 1 c,n,z 64 rlnc rlnc f f = rotate left (no carry) f 1 1 n,z rlnc f,wreg wreg = rotate left (no carry) f 1 1 n,z rlnc ws,wd wd = rotate left (no carry) ws 1 1 n,z 65 rrc rrc f f = rotate right through carry f 1 1 c,n,z rrc f,wreg wreg = rotate right through carry f 1 1 c,n,z rrc ws,wd wd = rotate right through carry ws 1 1 c,n,z table 22-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected
dspic33fjxxxgpx06/x08/x10 ds70286a-page 260 ? 2007 microchip technology inc. 66 rrnc rrnc f f = rotate right (no carry) f 1 1 n,z rrnc f,wreg wreg = rotate right (no carry) f 1 1 n,z rrnc ws,wd wd = rotate right (no carry) ws 1 1 n,z 67 sac sac acc,#slit4,wdo store accumulator 1 1 none sac.r acc,#slit4,wdo store rounded accumulator 1 1 none 68 se se ws,wnd wnd = sign-extended ws 1 1 c,n,z 69 setm setm f f = 0xffff 1 1 none setm wreg wreg = 0xffff 1 1 none setm ws ws = 0xffff 1 1 none 70 sftac sftac acc,wn arithmetic shift accumulator by (wn) 1 1 oa,ob,oab, sa,sb,sab sftac acc,#slit6 arithmetic shift accumulator by slit6 1 1 oa,ob,oab, sa,sb,sab 71 sl sl f f = left shift f 1 1 c,n,ov,z sl f,wreg wreg = left shift f 1 1 c,n,ov,z sl ws,wd wd = left shift ws 1 1 c,n,ov,z sl wb,wns,wnd wnd = left shift wb by wns 1 1 n,z sl wb,#lit5,wnd wnd = left shift wb by lit5 1 1 n,z 72 sub sub acc subtract accumulators 1 1 oa,ob,oab, sa,sb,sab sub f f = f ? wreg 1 1 c,dc,n,ov,z sub f,wreg wreg = f ? wreg 1 1 c,dc,n,ov,z sub #lit10,wn wn = wn ? lit10 1 1 c,dc,n,ov,z sub wb,ws,wd wd = wb ? ws 1 1 c,dc,n,ov,z sub wb,#lit5,wd wd = wb ? lit5 1 1 c,dc,n,ov,z 73 subb subb f f = f ? wreg ? (c ) 1 1 c,dc,n,ov,z subb f,wreg wreg = f ? wreg ? (c ) 1 1 c,dc,n,ov,z subb #lit10,wn wn = wn ? lit10 ? (c ) 1 1 c,dc,n,ov,z subb wb,ws,wd wd = wb ? ws ? (c ) 1 1 c,dc,n,ov,z subb wb,#lit5,wd wd = wb ? lit5 ? (c ) 1 1 c,dc,n,ov,z 74 subr subr f f = wreg ? f 1 1 c,dc,n,ov,z subr f,wreg wreg = wreg ? f 1 1 c,dc,n,ov,z subr wb,ws,wd wd = ws ? wb 1 1 c,dc,n,ov,z subr wb,#lit5,wd wd = lit5 ? wb 1 1 c,dc,n,ov,z 75 subbr subbr f f = wreg ? f ? (c ) 1 1 c,dc,n,ov,z subbr f,wreg wreg = wreg ? f ? (c ) 1 1 c,dc,n,ov,z subbr wb,ws,wd wd = ws ? wb ? (c ) 1 1 c,dc,n,ov,z subbr wb,#lit5,wd wd = lit5 ? wb ? (c ) 1 1 c,dc,n,ov,z 76 swap swap.b wn wn = nibble swap wn 1 1 none swap wn wn = byte swap wn 1 1 none 77 tblrdh tblrdh ws,wd read prog<23:16> to wd<7:0> 1 2 none 78 tblrdl tblrdl ws,wd read prog<15:0> to wd 1 2 none 79 tblwth tblwth ws,wd write ws<7:0> to prog<23:16> 1 2 none 80 tblwtl tblwtl ws,wd write ws to prog<15:0> 1 2 none 81 ulnk ulnk unlink frame pointer 1 1 none 82 xor xor f f = f .xor. wreg 1 1 n,z xor f,wreg wreg = f .xor. wreg 1 1 n,z xor #lit10,wn wd = lit10 .xor. wd 1 1 n,z xor wb,ws,wd wd = wb .xor. ws 1 1 n,z xor wb,#lit5,wd wd = wb .xor. lit5 1 1 n,z 83 ze ze ws,wnd wnd = zero-extend ws 1 1 c,z,n table 22-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected
? 2007 microchip technology inc. ds70286a-page 261 dspic33fjxxxgpx06/x08/x10 23.0 development support the pic ? microcontrollers are supported with a full range of hardware and software development tools: ? integrated development environment - mplab ? ide software ? assemblers/compilers/linkers - mpasm tm assembler - mplab c18 and mplab c30 c compilers -mplink tm object linker/ mplib tm object librarian - mplab asm30 assembler/linker/library ? simulators - mplab sim software simulator ?emulators - mplab ice 2000 in-circuit emulator - mplab real ice? in-circuit emulator ? in-circuit debugger - mplab icd 2 ? device programmers - picstart ? plus development programmer - mplab pm3 device programmer - pickit? 2 development programmer ? low-cost demonstration and development boards and evaluation kits 23.1 mplab integrated development environment software the mplab ide software brings an ease of software development previously unseen in the 8/16-bit micro- controller market. the mplab ide is a windows ? operating system-based application that contains: ? a single graphical interface to all debugging tools - simulator - programmer (sold separately) - emulator (sold separately) - in-circuit debugger (sold separately) ? a full-featured editor with color-coded context ? a multiple project manager ? customizable data windows with direct edit of contents ? high-level source code debugging ? visual device initializer for easy register initialization ? mouse over variable inspection ? drag and drop variables from source to watch windows ? extensive on-line help ? integration of select third party tools, such as hi-tech software c compilers and iar c compilers the mplab ide allows you to: ? edit your source files (either assembly or c) ? one touch assemble (or compile) and download to pic mcu emulator and simulator tools (automatically updates all project information) ? debug using: - source files (assembly or c) - mixed assembly and c - machine code mplab ide supports multiple debugging tools in a single development paradigm, from the cost-effective simulators, through low-cost in-circuit debuggers, to full-featured emulators. this eliminates the learning curve when upgrading to tools with increased flexibility and power.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 262 ? 2007 microchip technology inc. 23.2 mpasm assembler the mpasm assembler is a full-featured, universal macro assembler for all pic mcus. the mpasm assembler generates relocatable object files for the mplink object linker, intel ? standard hex files, map files to detail memory usage and symbol reference, absolute lst files that contain source lines and generated machine code and coff files for debugging. the mpasm assembler features include: ? integration into mplab ide projects ? user-defined macros to streamline assembly code ? conditional assembly for multi-purpose source files ? directives that allow complete control over the assembly process 23.3 mplab c18 and mplab c30 c compilers the mplab c18 and mplab c30 code development systems are complete ansi c compilers for microchip?s pic18 and pic24 families of microcontrol- lers and the dspic30 and dspic33 family of digital sig- nal controllers. these compilers provide powerful integration capabilities, superior code optimization and ease of use not found with other compilers. for easy source level debugging, the compilers provide symbol information that is optimized to the mplab ide debugger. 23.4 mplink object linker/ mplib object librarian the mplink object linker combines relocatable objects created by the mpasm assembler and the mplab c18 c compiler. it can link relocatable objects from precompiled libraries, using directives from a linker script. the mplib object librarian manages the creation and modification of library files of precompiled code. when a routine from a library is called from a source file, only the modules that contain that routine will be linked in with the application. this allows large libraries to be used efficiently in many different applications. the object linker/library features include: ? efficient linking of single libraries instead of many smaller files ? enhanced code maintainability by grouping related modules together ? flexible creation of libraries with easy module listing, replacement, deletion and extraction 23.5 mplab asm30 assembler, linker and librarian mplab asm30 assembler produces relocatable machine code from symbolic assembly language for dspic30f devices. mplab c30 c compiler uses the assembler to produce its object file. the assembler generates relocatable object files that can then be archived or linked with other relocatable object files and archives to create an executable file. notable features of the assembler include: ? support for the entire dspic30f instruction set ? support for fixed-point and floating-point data ? command line interface ? rich directive set ? flexible macro language ? mplab ide compatibility 23.6 mplab sim software simulator the mplab sim software simulator allows code development in a pc-hosted environment by simulat- ing the pic mcus and dspic ? dscs on an instruction level. on any given instruction, the data areas can be examined or modified and stimuli can be applied from a comprehensive stimulus controller. registers can be logged to files for further run-time analysis. the trace buffer and logic analyzer display extend the power of the simulator to record and track program execution, actions on i/o, most peripherals and internal registers. the mplab sim software simulator fully supports symbolic debugging using the mplab c18 and mplab c30 c compilers, and the mpasm and mplab asm30 assemblers. the software simulator offers the flexibility to develop and debug code outside of the hardware laboratory environment, making it an excellent, economical software development tool.
? 2007 microchip technology inc. ds70286a-page 263 dspic33fjxxxgpx06/x08/x10 23.7 mplab ice 2000 high-performance in-circuit emulator the mplab ice 2000 in-circuit emulator is intended to provide the product development engineer with a complete microcontroller design tool set for pic microcontrollers. software control of the mplab ice 2000 in-circuit emulator is advanced by the mplab integrated development environment, which allows editing, building, downloading and source debugging from a single environment. the mplab ice 2000 is a full-featured emulator system with enhanced trace, trigger and data monitor- ing features. interchangeable processor modules allow the system to be easily reconfigured for emulation of different processors. the architecture of the mplab ice 2000 in-circuit emulator allows expansion to support new pic microcontrollers. the mplab ice 2000 in-circuit emulator system has been designed as a real-time emulation system with advanced features that are typically found on more expensive development tools. the pc platform and microsoft ? windows ? 32-bit operating system were chosen to best make these features available in a simple, unified application. 23.8 mplab real ice in-circuit emulator system mplab real ice in-circuit emulator system is microchip?s next generation high-speed emulator for microchip flash dsc ? and mcu devices. it debugs and programs pic ? and dspic ? flash microcontrollers with the easy-to-use, powerful graphical user interface of the mplab integrated development environment (ide), included with each kit. the mplab real ice probe is connected to the design engineer?s pc using a high-speed usb 2.0 interface and is connected to the target with either a connector compatible with the popular mplab icd 2 system (rj11) or with the new high speed, noise tolerant, low- voltage differential signal (lvds) interconnection (cat5). mplab real ice is field upgradeable through future firmware downloads in mplab ide. in upcoming releases of mplab ide, new devices will be supported, and new features will be added, such as software break- points and assembly code trace. mplab real ice offers significant advantages over competitive emulators including low-cost, full-speed emulation, real-time variable watches, trace analysis, complex breakpoints, a ruggedized probe interface and long (up to three meters) interconnection cables. 23.9 mplab icd 2 in-circuit debugger microchip?s in-circuit debugger, mplab icd 2, is a powerful, low-cost, run-time development tool, connecting to the host pc via an rs-232 or high-speed usb interface. this tool is based on the flash pic mcus and can be used to develop for these and other pic mcus and dspic dscs. the mplab icd 2 utilizes the in-circuit debugging capability built into the flash devices. this feature, along with microchip?s in-circuit serial programming tm (icsp tm ) protocol, offers cost- effective, in-circuit flash debugging from the graphical user interface of the mplab integrated development environment. this enables a designer to develop and debug source code by setting breakpoints, single step- ping and watching variables, and cpu status and peripheral registers. running at full speed enables testing hardware and applications in real time. mplab icd 2 also serves as a development programmer for selected pic devices. 23.10 mplab pm3 device programmer the mplab pm3 device programmer is a universal, ce compliant device programmer with programmable voltage verification at v ddmin and v ddmax for maximum reliability. it features a large lcd display (128 x 64) for menus and error messages and a modu- lar, detachable socket assembly to support various package types. the icsp? cable assembly is included as a standard item. in stand-alone mode, the mplab pm3 device programmer can read, verify and program pic devices without a pc connection. it can also set code protection in this mode. the mplab pm3 connects to the host pc via an rs-232 or usb cable. the mplab pm3 has high-speed communications and optimized algorithms for quick programming of large memory devices and incorporates an sd/mmc card for file storage and secure data applications.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 264 ? 2007 microchip technology inc. 23.11 picstart plus development programmer the picstart plus development programmer is an easy-to-use, low-cost, prototype programmer. it connects to the pc via a com (rs-232) port. mplab integrated development environment software makes using the programmer simple and efficient. the picstart plus development programmer supports most pic devices in dip packages up to 40 pins. larger pin count devices, such as the pic16c92x and pic17c76x, may be supported with an adapter socket. the picstart plus development programmer is ce compliant. 23.12 pickit 2 development programmer the pickit? 2 development programmer is a low-cost programmer and selected flash device debugger with an easy-to-use interface for programming many of microchip?s baseline, mid-range and pic18f families of flash memory microcontrollers. the pickit 2 starter kit includes a prototyping development board, twelve sequential lessons, software and hi-tech?s picc? lite c compiler, and is designed to help get up to speed quickly using pic ? microcontrollers. the kit provides everything needed to program, evaluate and develop applications using microchip?s powerful, mid-range flash memory family of microcontrollers. 23.13 demonstration, development and evaluation boards a wide variety of demonstration, development and evaluation boards for various pic mcus and dspic dscs allows quick application development on fully func- tional systems. most boards include prototyping areas for adding custom circuitry and provide application firmware and source code for examination and modification. the boards support a variety of features, including leds, temperature sensors, switches, speakers, rs-232 interfaces, lcd displays, potentiometers and additional eeprom memory. the demonstration and development boards can be used in teaching environments, for prototyping custom circuits and for learning about various microcontroller applications. in addition to the picdem? and dspicdem? demon- stration/development board series of circuits, microchip has a line of evaluation kits and demonstration software for analog filter design, k ee l oq ? security ics, can, irda ? , powersmart ? battery management, seeval ? evaluation system, sigma-delta adc, flow rate sensing, plus many more. check the microchip web page (www.microchip.com) and the latest ?product selector guide? (ds00148) for the complete list of demonstration, development and evaluation kits.
? 2007 microchip technology inc. ds70286a-page 265 dspic33fjxxxgpx06/x08/x10 24.0 electrical characteristics this section provides an overview of dspic33fjxxxgpx06/x08/x10 electrical characteristics. additional information will be provided in future revisions of this document as it becomes available. absolute maximum ratings for the dspic33fjxxxgpx06/x08/x10 family are listed below. exposure to these maximum rating conditions for extended periods may affect device reliability. functional operation of the device at these or any other conditions above the parameters indicated in the operation listings of this specification is not implied. absolute maximum ratings (note 1) ambient temperature under bias................................................................................................. ............. .-40c to +85c storage temperature ............................................................................................................ .................. -65c to +150c voltage on v dd with respect to v ss ......................................................................................................... -0.3v to +4.0v voltage on any combined analog and digital pin and mclr , with respect to v ss ......................... -0.3v to (v dd + 0.3v) voltage on any digital-only pin with respect to v ss .................................................................................. -0.3v to +5.6v voltage on v ddcore with respect to v ss ................................................................................................ 2.25v to 2.75v maximum current out of v ss pin ........................................................................................................................... 300 ma maximum current into v dd pin (note 2) ................................................................................................................250 ma maximum output current sunk by any i/o pin (note 3) .............................................................................................4 ma maximum output current sourced by any i/o pin (note 3) ........................................................................................4 ma maximum current sunk by all ports .............................................................................................. .........................200 ma maximum current sourced by all ports (note 2) ....................................................................................................200 ma note 1: stresses above those listed under ?absolute maximum ratings? may cause permanent damage to the device. this is a stress rating only and functional operation of the device at those or any other conditions above those indicated in the operation listings of this specification is not implied. exposure to maximum rating conditions for extended periods may affect device reliability. 2: maximum allowable current is a function of device maximum power dissipation (see table 24-2). 3: exceptions are clkout, which is able to sink/source 25 ma, and the v ref +, v ref -, sclx, sdax, pgcx and pgdx pins, which are able to sink/source 12 ma.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 266 ? 2007 microchip technology inc. 24.1 dc characteristics table 24-1: operating mips vs. voltage characteristic v dd range (in volts) temp range (in c) max mips dspic33fjxxxgpx06/x08/x10 dc5 3.0-3.6v -40c to +85c 40 table 24-2: thermal operating conditions rating symbol min typ max unit dspic33fjxxxgpx06/x08/x10 operating junction temperature range t j -40 ? +125 c operating ambient temperature range t a -40 ? +85 c power dissipation: internal chip power dissipation: p int = v dd x (i dd ? i oh ) p d p int + p i / o w i/o pin power dissipation: i/o = ({v dd ? v oh } x i oh ) + (v ol x i ol ) maximum allowed power dissipation p dmax (t j ? t a )/ ja w table 24-3: thermal packaging characteristics characteristic symbol typ max unit notes package thermal resistance, 100-pin tqfp (14x14x1 mm) ja 48.4 ? c/w 1 package thermal resistance, 100-pin tqfp (12x12x1 mm) ja 52.3 ? c/w 1 package thermal resistance, 80-pin tqfp (12x12x1 mm) ja 38.7 ? c/w 1 package thermal resistance, 64-pin tqfp (10x10x1 mm) ja 38.3 ? c/w 1 note 1: junction to ambient thermal resistance, theta- ja ( ja ) numbers are achieved by package simulations. table 24-4: dc temperature and voltage specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. symbol characteristic min typ (1) max units conditions operating voltage dc10 supply voltage v dd 3.0 ? 3.6 v dc12 v dr ram data retention voltage (2) 1.1 1.3 1.8 v dc16 v por v dd start voltage (4) to ensure internal power-on reset signal ??v ss v dc17 s vdd v dd rise rate to ensure internal power-on reset signal 0.03 ? ? v/ms 0-3.0v in 0.1s dc18 v core v dd core (3) internal regulator voltage 2.25 ? 2.75 v voltage is dependent on load, temperature and v dd note 1: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 2: this is the limit to which v dd can be lowered without losing ram data. 3: these parameters are characterized but not tested in manufacturing. 4: v dd core voltage must remain at v ss for a minimum of 200 s to ensure por.
? 2007 microchip technology inc. ds70286a-page 267 dspic33fjxxxgpx06/x08/x10 table 24-5: dc characteristics: operating current (i dd ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial parameter no. typical (1) max units conditions operating current (i dd ) (2) dc20d 24 29 ma -40c 3.3v 10 mips dc20 27 30 ma +25c dc20a 27 31 ma +85c dc21d 36 42 ma -40c 3.3v 16 mips dc21 37 42 ma +25c dc21a 38 43 ma +85c dc22d 43 50 ma -40c 3.3v 20 mips dc22 46 51 ma +25c dc22a 46 52 ma +85c dc23d 61 70 ma -40c 3.3v 30 mips dc23 65 70 ma +25c dc23a 65 71 ma +85c dc24d 83 88 ma -40c 3.3v 40 mips dc24 84 88 ma +25c dc24a 84 89 ma +85c note 1: data in ?typical? column is at 3.3v, 25c unless otherwise stated. 2: the supply current is mainly a function of the operating voltage and frequency. other factors, such as i/o pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current consumption. the test conditions for all i dd measurements are as follows: osc1 driven with external square wave from rail to rail. all i/o pins are configured as inputs and pulled to v ss . mclr = v dd , wdt and fscm are disabled. cpu, sram, program memory and data memory are operational. no peripheral modules are operating; however, every peripheral is being clocked (pmd bits are all zeroed).
dspic33fjxxxgpx06/x08/x10 ds70286a-page 268 ? 2007 microchip technology inc. table 24-6: dc characteristics: idle current (i idle ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial parameter no. typical (1) max units conditions idle current (i idle ): core off clock on base current (2) dc40d 3 7 ma -40c 3.3v 10 mips dc40 3 7 ma +25c dc40a 3 8 ma +85c dc40d 5 10 ma -40c 3.3v 16 mips dc41 5 10 ma +25c dc41a 6 11 ma +85c dc42d 9 12 ma -40c 3.3v 20 mips dc42 9 15 ma +25c dc42a 10 16 ma +85c dc43d 15 17 ma -40c 3.3v 30 mips dc43 15 21 ma +25c dc43a 15 22 ma +85c dc44d 16 21 ma -40c 3.3v 40 mips dc44 16 23 ma +25c dc44a 16 24 ma +85c note 1: data in ?typical? column is at 3.3v, 25c unless otherwise stated. 2: base i idle current is measured with core off, clock on and all modules turned off. peripheral module disable sfr registers are zeroed. all i/o pins are configured as inputs and pulled to v ss . table 24-7: dc characteristics: power-down current (i pd ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial parameter no. typical (1) max units conditions power-down current (i pd ) (2) dc60d 290 963 a-40c 3.0v base power-down current (3,4) dc60 293 988 a+25c dc60a 317 990 a+85c dc61d 8 13 a-40c 3.0v watchdog timer current: i wdt (3) dc61 10 15 a+25c dc61a 12 20 a+85c note 1: data in the typical column is at 3.3v, 25c unless otherwise stated. 2: base i pd is measured with all peripherals and clocks shut down. all i/os are configured as inputs and pulled to v ss . wdt, etc., are all switched off. 3: the current is the additional current consumed when the module is enabled. this current should be added to the base i pd current. 4: these currents are measured on the device containing the most memory in this family.
? 2007 microchip technology inc. ds70286a-page 269 dspic33fjxxxgpx06/x08/x10 table 24-8: dc characteristics: doze current (i doze ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial parameter no. typical (1) max doze ratio units conditions dc73a 25 32 1:2 ma -40c 3.3v 40 mips dc73f 23 27 1:64 dc73g 23 26 1:128 dc70a 42 47 1:2 ma +25c dc70f 26 27 1:64 dc70g 25 27 1:128 dc71a 41 48 1:2 ma +85c dc71f 25 28 1:64 dc71g 24 28 1:128 note 1: data in the typical column is at 3.3v, 25c unless otherwise stated.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 270 ? 2007 microchip technology inc. table 24-9: dc characteristics: i/o pin input specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. symbol characteristic min typ (1) max units conditions v il input low voltage di10 i/o pins v ss ?0.2v dd v di15 mclr v ss ?0.2v dd v di16 osc1 (xt mode) v ss ?0.2v dd v di17 osc1 (hs mode) v ss ?0.2v dd v di18 sdax, sclx v ss ? 0.3 v dd v smbus disabled di19 sdax, sclx v ss ? 0.2 v dd v smbus enabled v ih input high voltage di20 i/o pins: with analog functions digital-only 0.8 v dd 0.8 v dd ? ? v dd 5.5 v v di25 mclr 0.8 v dd ?v dd v di26 osc1 (xt mode) 0.7 v dd ?v dd v di27 osc1 (hs mode) 0.7 v dd ?v dd v di28 sdax, sclx 0.7 v dd ?v dd v smbus disabled di29 sdax, sclx 0.8 v dd ?v dd v smbus enabled i cnpu cnx pull-up current di30 50 250 400 av dd = 3.3v, v pin = v ss i il input leakage current (2,3) di50 i/o ports ? ? 2 av ss v pin v dd , pin at high-impedance di51 analog input pins ? ? 1 av ss v pin v dd , pin at high-impedance di51a analog input pins ? ? 2 a analog pins shared with external reference pins di55 mclr ??2 av ss v pin v dd di56 osc1 ? ? 2 av ss v pin v dd , xt and hs modes note 1: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 2: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current may be measured at different input voltages. 3: negative current is defined as current sourced by the pin.
? 2007 microchip technology inc. ds70286a-page 271 dspic33fjxxxgpx06/x08/x10 table 24-10: dc characteristics: i/o pin output specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. symbol characteristic min typ max units conditions v ol output low voltage do10 i/o ports ? ? 0.4 v i ol = 2 ma, v dd = 3.3v do16 osc2/clko ? ? 0.4 v i ol = 2 ma, v dd = 3.3v v oh output high voltage do20 i/o ports 2.40 ? ? v i oh = -2.3 ma, v dd = 3.3v do26 osc2/clko 2.41 ? ? v i oh = -1.3 ma, v dd = 3.3v table 24-11: electrical characteristics: bor dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. symbol characteristic min (1) typ max (1) units conditions bo10 v bor bor event on v dd transition high-to-low bor event is tied to v dd core voltage decrease 2.40 ? 2.55 v -40c to +85c note 1: parameters are for design guidance only and are not tested in manufacturing.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 272 ? 2007 microchip technology inc. table 24-13: internal voltag e regulator specifications table 24-12: dc characteristics: program memory dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. symbol characteristic min typ (1) max units conditions program flash memory d130 e p cell endurance 100 1000 ? e/w -40 c to +85 c d131 v pr v dd for read v min ?3.6vv min = minimum operating voltage d132b v pew v dd for self-timed write v min ?3.6vv min = minimum operating voltage d134 t retd characteristic retention 20 ? ? year provided no other specifications are violated d135 i ddp supply current during programming ?10 ?ma d136 t rw row write time ? 1.6 ? ms d137 t pe page erase time ? 20 ? ms d138 t ww word write cycle time 20 ? 40 s note 1: data in ?typ? column is at 3.3v, 25c unless otherwise stated. operating conditions: -40c < t a < +85c (unless otherwise stated) param no. symbol characteristics min typ max units comments c efc external filter capacitor value 110? f capacitor must be low series resistance (< 5 ohms)
? 2007 microchip technology inc. ds70286a-page 273 dspic33fjxxxgpx06/x08/x10 24.2 ac characteristics and timing parameters the information contained in this section defines dspic33fjxxxgpx06/x08/x10 ac characteristics and timing parameters. table 24-14: temperature and vo ltage specifications ? ac figure 24-1: load conditions for device timing specifications table 24-15: capacitiv e loading requirements on output pins ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial operating voltage v dd range as described in section 24.0 ?electrical characteristics? . param no. symbol characteristic min typ max units conditions do50 c osc 2 osc2/sosc2 pin ? ? 15 pf in xt and hs modes when external clock is used to drive osc1 do56 c io all i/o pins and osc2 ? ? 50 pf ec mode do58 c b sclx, sdax ? ? 400 pf in i 2 c? mode v dd /2 c l r l pin pin v ss v ss c l r l = 464 c l = 50 pf for all pins except osc2 15 pf for osc2 output load condition 1 ? for all pins except osc2 load condition 2 ? for osc2
dspic33fjxxxgpx06/x08/x10 ds70286a-page 274 ? 2007 microchip technology inc. figure 24-2: external clock timing table 24-16: external clo ck timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. symb characteristic min typ (1) max units conditions os10 f in external clki frequency (external clocks allowed only in ec and ecpll modes) dc ? 40 mhz ec oscillator crystal frequency 3.5 10 ? ? ? ? 10 40 33 mhz mhz khz xt hs sosc os20 t osc t osc = 1/f osc 12.5 ? dc ns os25 t cy instruction cycle time (2) 25 ? dc ns os30 tosl, to s h external clock in (osc1) high or low time 0.375 x t osc ? 0.625 x t osc ns ec os31 tosr, to s f external clock in (osc1) rise or fall time ??20nsec os40 tckr clko rise time (3) ?5.2? ns os41 tckf clko fall time (3) ?5.2? ns note 1: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 2: instruction cycle period (t cy ) equals two times the input oscillator time-base period. all specified values are based on characterization data for that particular oscillator type under standard operating conditions with the device executing code. exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumpt ion. all devices are tested to operate at ?min.? values with an external clock applied to the osc1/clki pin. when an external clock input is used, the ?max.? cycle time limit is ?dc? (no clock) for all devices. 3: measurements are taken in ec mode. the clko signal is measured on the osc2 pin. q1 q2 q3 q4 osc1 clko q1 q2 q3 q4 os20 os25 os30 os30 os40 os41 os31 os31
? 2007 microchip technology inc. ds70286a-page 275 dspic33fjxxxgpx06/x08/x10 table 24-17: pll clock ti ming specifications (v dd = 3.0v to 3.6v) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. symbol characteristic min typ (1) max units conditions os50 f plli pll voltage controlled oscillator (vco) input frequency range (2) 0.8 ? 8.0 mhz ecpll, hspll, xtpll modes os51 f sys on-chip vco system frequency 100 ? 200 mhz os52 t lock pll start-up time (lock time) 0.9 1.5 3.1 ms os53 d clk clko stability (jitter) -3.0 0.5 3.0 % measured over 100 ms period note 1: data in ?typ? column is at 3.3v, 25c unless otherwise stated. table 24-18: ac characteristics: internal rc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ta +85c for industrial param no. characteristic min typ max units conditions internal frc accuracy @ frc frequency = 7.37 mhz (1,2) f20 frc -2 ? +2 % -40c t a +85c v dd = 3.0-3.6v note 1: frequency calibrated at 25c and 3.3v. tun bits can be used to compensate for temperature drift. 2: frc is set to initial frequency of 7.37 mhz (2%) at 25c frc. table 24-19: internal rc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. characteristic min typ max units conditions lprc @ 32.768 khz (1) f21 -20 6 +20 % -40c t a +85c v dd = 3.0-3.6v note 1: change of lprc frequency as v dd changes.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 276 ? 2007 microchip technology inc. figure 24-3: clko and i/o ti ming characteristics table 24-20: clko and i/ o timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial param no. symbol characteristic min typ (1) max units conditions do31 t io r port output rise time ? 10 25 ns ? do32 t io f port output fall time ? 10 25 ns ? di35 t inp intx pin high or low time (output) 20 ? ? ns ? di40 t rbp cnx high or low time (input) 2 ? ? t cy ? note 1: data in ?typ? column is at 3.3v, 25c unless otherwise stated. note: refer to figure 24-1 for load conditions. i/o pin (input) i/o pin (output) di35 old value new value di40 do31 do32
? 2007 microchip technology inc. ds70286a-page 277 dspic33fjxxxgpx06/x08/x10 figure 24-4: reset, watchdog timer, os cillator start-up timer and power-up timer timing characteristics v dd mclr internal por pwrt time-out osc time-out internal reset watchdog timer reset sy11 sy10 sy20 sy13 i/o pins sy13 note: refer to figure 24-1 for load conditions. fscm delay sy35 sy30 sy12
dspic33fjxxxgpx06/x08/x10 ds70286a-page 278 ? 2007 microchip technology inc. table 24-21: reset, watchdog timer, oscill ator start-up timer, power-up timer timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ (2) max units conditions sy10 t mc lmclr pulse width (low) 2 ? ? s -40c to +85c sy11 t pwrt power-up timer period ? ? ? ? ? ? ? 2 4 8 16 32 64 128 ? ? ? ? ? ? ? ms -40c to +85c user programmable sy12 t por power-on reset delay 3 10 30 s -40c to +85c sy13 t ioz i/o high-impedance from mclr low or watchdog timer reset 0.68 0.72 1.2 s sy20 t wdt 1 watchdog timer time-out period (no prescaler) 1.7 2.1 2.6 ms v dd = 3v, -40c to +85c sy30 t ost oscillator start-up timer period ? 1024 t osc ??t osc = osc1 period sy35 t fscm fail-safe clock monitor delay ? 500 900 s -40c to +85c note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typ? column is at 5v, 25c unless otherwise stated.
? 2007 microchip technology inc. ds70286a-page 279 dspic33fjxxxgpx06/x08/x10 figure 24-5: timer1, 2, 3, 4, 5, 6, 7, 8 and 9 external clock timing characteristics note: refer to figure 24-1 for load conditions. tx11 tx15 tx10 tx20 tmrx os60 txck table 24-22: timer1 external clock timing requirements (1) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic min typ max units conditions ta10 t tx h txck high time synchronous, no prescaler 0.5 t cy + 20 ? ? ns must also meet parameter ta15 synchronous, with prescaler 10 ? ? ns asynchronous 10 ? ? ns ta11 t tx l txck low time synchronous, no prescaler 0.5 t cy + 20 ? ? ns must also meet parameter ta15 synchronous, with prescaler 10 ? ? ns asynchronous 10 ? ? ns ta15 t tx p txck input period synchronous, no prescaler t cy + 40 ? ? ns synchronous, with prescaler greater of: 20 ns or (t cy + 40)/n ???n = prescale value (1, 8, 64, 256) asynchronous 20 ? ? ns os60 ft1 sosc1/t1ck oscillator input frequency range (oscillator enabled by setting bit tcs (t1con<1>)) dc ? 50 khz ta20 t ckextmrl delay from external txck clock edge to timer increment 0.5 t cy 1.5 t cy ? note 1: timer1 is a type a.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 280 ? 2007 microchip technology inc. table 24-23: timer2, timer4, timer6 and timer8 external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic min typ max units conditions tb10 ttxh txck high time synchronous, no prescaler 0.5 t cy + 20 ? ? ns must also meet parameter tb15 synchronous, with prescaler 10 ? ? ns tb11 ttxl txck low time synchronous, no prescaler 0.5 t cy + 20 ? ? ns must also meet parameter tb15 synchronous, with prescaler 10 ? ? ns tb15 ttxp txck input period synchronous, no prescaler t cy + 40 ? ? ns n = prescale value (1, 8, 64, 256) synchronous, with prescaler greater of: 20 ns or (t cy + 40)/n tb20 t ckext - mrl delay from external txck clock edge to timer increment 0.5 t cy ? 1.5 t cy ? table 24-24: timer3, timer5, timer7 and timer9 external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic min typ max units conditions tc10 ttxh txck high time synchronous 0.5 t cy + 20 ? ? ns must also meet parameter tc15 tc11 ttxl txck low time synchronous 0.5 t cy + 20 ? ? ns must also meet parameter tc15 tc15 ttxp txck input period synchronous, no prescaler t cy + 40 ? ? ns n = prescale value (1, 8, 64, 256) synchronous, with prescaler greater of: 20 ns or (t cy + 40)/n tc20 t ckextmrl delay from external txck clock edge to timer increment 0.5 t cy ?1.5 t cy ?
? 2007 microchip technology inc. ds70286a-page 281 dspic33fjxxxgpx06/x08/x10 figure 24-6: input capture (capx) timing characteristics figure 24-7: output compare module (o cx) timing characteristics table 24-25: input capture timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min max units conditions ic10 tccl icx input low time no prescaler 0.5 t cy + 20 ? ns with prescaler 10 ? ns ic11 tcch icx input high time no prescaler 0.5 t cy + 20 ? ns with prescaler 10 ? ns ic15 tccp icx input period (t cy + 40)/n ? ns n = prescale value (1, 4, 16) note 1: these parameters are characterized but not tested in manufacturing. table 24-26: output compare module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ max units conditions oc10 tccf ocx output fall time ? ? ? ns see parameter d032 oc11 tccr ocx output rise time ? ? ? ns see parameter d031 note 1: these parameters are characterized but not tested in manufacturing. icx ic10 ic11 ic15 note: refer to figure 24-1 for load conditions. ocx oc11 oc10 (output compare note: refer to figure 24-1 for load conditions. or pwm mode)
dspic33fjxxxgpx06/x08/x10 ds70286a-page 282 ? 2007 microchip technology inc. figure 24-8: oc/pwm module ti ming characteristics table 24-27: simple oc/pwm mode timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ max units conditions oc15 t fd fault input to pwm i/o change ? ? 50 ns ? oc20 t flt fault input pulse width 50 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. ocfa/ocfb ocx oc20 oc15
? 2007 microchip technology inc. ds70286a-page 283 dspic33fjxxxgpx06/x08/x10 figure 24-9: spix module master mode (cke = 0 ) timing characteristics sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sdix sp11 sp10 sp40 sp41 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 msb in lsb in bit 14 - - - -1 sp30 sp31 note: refer to figure 24-1 for load conditions. table 24-28: spix master mode (cke = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ (2) max units conditions sp10 tscl sckx output low time (3) t cy /2 ? ? ns ? sp11 tsch sckx output high time (3) t cy /2 ? ? ns ? sp20 tscf sckx output fall time (4) ? ? ? ns see parameter d032 sp21 tscr sckx output rise time (4) ? ? ? ns see parameter d031 sp30 tdof sdox data output fall time (4) ? ? ? ns see parameter d032 sp31 tdor sdox data output rise time (4) ? ? ? ns see parameter d031 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 23 ? ? ns ? sp41 tsch2dil, ts c l 2 d i l hold time of sdix data input to sckx edge 30 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 3: the minimum clock period for sckx is 100 ns. therefore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 284 ? 2007 microchip technology inc. figure 24-10: spix module master mode (cke = 1 ) timing characteristics table 24-29: spix module master mode (cke = 1 ) timing requirements sck x (ckp = 0 ) sck x (ckp = 1 ) sdo x sdi x sp36 sp30,sp31 sp35 msb msb in bit 14 - - - - - -1 lsb in bit 14 - - - -1 lsb note: refer to figure 24-1 for load conditions. sp11 sp10 sp20 sp21 sp21 sp20 sp40 sp41 ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ (2) max units conditions sp10 tscl sckx output low time (3) t cy /2 ? ? ns ? sp11 tsch sckx output high time (3) t cy /2 ? ? ns ? sp20 tscf sckx output fall time (4) ? ? ? ns see parameter d032 sp21 tscr sckx output rise time (4) ? ? ? ns see parameter d031 sp30 tdof sdox data output fall time (4) ? ? ? ns see parameter d032 sp31 tdor sdox data output rise time (4) ? ? ? ns see parameter d031 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ?620ns ? sp36 tdov2sc, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 23 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 3: the minimum clock period for sckx is 100 ns. therefore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins.
? 2007 microchip technology inc. ds70286a-page 285 dspic33fjxxxgpx06/x08/x10 figure 24-11: spix modul e slave mode (cke = 0 ) timing characteristics ss x sck x (ckp = 0 ) sck x (ckp = 1 ) sdo x sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp71 sp70 note: refer to figure 24-1 for load conditions. sdi x table 24-30: spix modul e slave mode (cke = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ (2) max units conditions sp70 tscl sckx input low time 30 ? ? ns ? sp71 tsch sckx input high time 30 ? ? ns ? sp72 tscf sckx input fall time (3) ? 1025ns ? sp73 tscr sckx input rise time (3) ? 1025ns ? sp30 tdof sdox data output fall time (3) ? ? ? ns see parameter d032 sp31 tdor sdox data output rise time (3) ? ? ? ns see parameter d031 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? ? 30 ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 20 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 20 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (3) 10 ? 50 ns ? sp52 tsch2ssh tscl2ssh ssx after sckx edge 1.5 t cy +40 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 3: assumes 50 pf load on all spix pins.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 286 ? 2007 microchip technology inc. figure 24-12: spix modul e slave mode (cke = 1 ) timing characteristics ssx sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sdi sp50 sp60 sdix sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp52 sp73 sp72 sp72 sp73 sp71 sp70 sp40 sp41 note: refer to figure 24-1 for load conditions. table 24-31: spix modul e slave mode (cke = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ (2) max units conditions sp70 tscl sckx input low time 30 ? ? ns ? sp71 tsch sckx input high time 30 ? ? ns ? sp72 tscf sckx input fall time (3) ?1025ns ? sp73 tscr sckx input rise time (3) ?1025ns ? sp30 tdof sdox data output fall time (3) ? ? ? ns see parameter d032 sp31 tdor sdox data output rise time (3) ? ? ? ns see parameter d031 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? ? 30 ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 20 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 20 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdo x output high-impedance (4) 10 ? 50 ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 3: the minimum clock period for sckx is 100 ns. therefore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins.
? 2007 microchip technology inc. ds70286a-page 287 dspic33fjxxxgpx06/x08/x10 sp52 tsch2ssh tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns ? sp60 tssl2dov sdox data output valid after ssx edge ??50ns ? table 24-31: spix modul e slave mode (cke = 1 ) timing requirements (continued) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ (2) max units conditions note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 3: the minimum clock period for sckx is 100 ns. therefore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 288 ? 2007 microchip technology inc. figure 24-13: i2cx bus start/stop bits ti ming characteristics (master mode) figure 24-14: i2cx bus data timing characteristics (master mode) im31 im34 sclx sdax start condition stop condition im30 im33 note: refer to figure 24-1 for load conditions. im11 im10 im33 im11 im10 im20 im26 im25 im40 im40 im45 im21 sclx sdax in sdax out note: refer to figure 24-1 for load conditions.
? 2007 microchip technology inc. ds70286a-page 289 dspic33fjxxxgpx06/x08/x10 table 24-32: i2cx bus data timing requirements (master mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic min (1) max units conditions im10 t lo : scl clock low time 100 khz mode t cy /2 (brg + 1) ? s? 400 khz mode t cy /2 (brg + 1) ? s? 1 mhz mode (2) t cy /2 (brg + 1) ? s? im11 t hi : scl clock high time 100 khz mode t cy /2 (brg + 1) ? s? 400 khz mode t cy /2 (brg + 1) ? s? 1 mhz mode (2) t cy /2 (brg + 1) ? s? im20 t f : scl sdax and sclx fall time 100 khz mode ? 300 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode (2) ? 100 ns im21 t r : scl sdax and sclx rise time 100 khz mode ? 1000 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode (2) ? 300 ns im25 t su : dat data input setup time 100 khz mode 250 ? ns ? 400 khz mode 100 ? ns 1 mhz mode (2) 40 ? ns im26 t hd : dat data input hold time 100 khz mode 0 ? s? 400 khz mode 0 0.9 s 1 mhz mode (2) 0.2 ? s im30 t su : sta start condition setup time 100 khz mode t cy /2 (brg + 1) ? s only relevant for repeated start condition 400 khz mode t cy /2 (brg + 1) ? s 1 mhz mode (2) t cy /2 (brg + 1) ? s im31 t hd : sta start condition hold time 100 khz mode t cy /2 (brg + 1) ? s after this period the first clock pulse is generated 400 khz mode t cy /2 (brg + 1) ? s 1 mhz mode (2) t cy /2 (brg + 1) ? s im33 t su : sto stop condition setup time 100 khz mode t cy /2 (brg + 1) ? s? 400 khz mode t cy /2 (brg + 1) ? s 1 mhz mode (2) t cy /2 (brg + 1) ? s im34 t hd : sto stop condition 100 khz mode t cy /2 (brg + 1) ? ns ? hold time 400 khz mode t cy /2 (brg + 1) ? ns 1 mhz mode (2) t cy /2 (brg + 1) ? ns im40 t aa : scl output valid from clock 100 khz mode ? 3500 ns ? 400 khz mode ? 1000 ns ? 1 mhz mode (2) ? 400 ns ? im45 t bf : sda bus free time 100 khz mode 4.7 ? s time the bus must be free before a new transmission can start 400 khz mode 1.3 ? s 1 mhz mode (2) 0.5 ? s im50 c b bus capacitive loading ? 400 pf note 1: brg is the value of the i 2 c baud rate generator. refer to section 19. ?inter-integrated circuit (i 2 c?)? in the ? dspic33f family reference manual? . 2: maximum pin capacitance = 10 pf for all i2cx pins (for 1 mhz mode only).
dspic33fjxxxgpx06/x08/x10 ds70286a-page 290 ? 2007 microchip technology inc. figure 24-15: i2cx bus start/stop bits timing characteristics (slave mode) figure 24-16: i2cx bus data timing characteristics (slave mode) is31 is34 sclx sdax start condition stop condition is30 is33 is30 is31 is33 is11 is10 is20 is26 is25 is40 is40 is45 is21 sclx sdax in sdax out
? 2007 microchip technology inc. ds70286a-page 291 dspic33fjxxxgpx06/x08/x10 table 24-33: i2cx bus data timing requirements (slave mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic min max units conditions is10 t lo : scl clock low time 100 khz mode 4.7 ? s device must operate at a minimum of 1.5 mhz 400 khz mode 1.3 ? s device must operate at a minimum of 10 mhz 1 mhz mode (1) 0.5 ? s? is11 t hi : scl clock high time 100 khz mode 4.0 ? s device must operate at a minimum of 1.5 mhz 400 khz mode 0.6 ? s device must operate at a minimum of 10 mhz 1 mhz mode (1) 0.5 ? s? is20 t f : scl sdax and sclx fall time 100 khz mode ? 300 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode (1) ? 100 ns is21 t r : scl sdax and sclx rise time 100 khz mode ? 1000 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode (1) ? 300 ns is25 t su : dat data input setup time 100 khz mode 250 ? ns ? 400 khz mode 100 ? ns 1 mhz mode (1) 100 ? ns is26 t hd : dat data input hold time 100 khz mode 0 ? s? 400 khz mode 0 0.9 s 1 mhz mode (1) 00.3 s is30 t su : sta start condition setup time 100 khz mode 4.7 ? s only relevant for repeated start condition 400 khz mode 0.6 ? s 1 mhz mode (1) 0.25 ? s is31 t hd : sta start condition hold time 100 khz mode 4.0 ? s after this period, the first clock pulse is generated 400 khz mode 0.6 ? s 1 mhz mode (1) 0.25 ? s is33 t su : sto stop condition setup time 100 khz mode 4.7 ? s? 400 khz mode 0.6 ? s 1 mhz mode (1) 0.6 ? s is34 t hd : sto stop condition hold time 100 khz mode 4000 ? ns ? 400 khz mode 600 ? ns 1 mhz mode (1) 250 ns is40 t aa : scl output valid from clock 100 khz mode 0 3500 ns ? 400 khz mode 0 1000 ns 1 mhz mode (1) 0 350 ns is45 t bf : sda bus free time 100 khz mode 4.7 ? s time the bus must be free before a new transmission can start 400 khz mode 1.3 ? s 1 mhz mode (1) 0.5 ? s is50 c b bus capacitive loading ? 400 pf ? note 1: maximum pin capacitance = 10 pf for all i2cx pins (for 1 mhz mode only).
dspic33fjxxxgpx06/x08/x10 ds70286a-page 292 ? 2007 microchip technology inc. figure 24-17: dci module (multi-channel, i 2 s modes) timing characteristics cofs csck (scke = 0 ) csck (scke = 1 ) csdo csdi cs11 cs10 cs40 cs41 cs21 cs20 cs35 cs21 msb lsb msb in lsb in cs31 high-z high-z 70 cs30 cs51 cs50 cs55 note: refer to figure 24-1 for load conditions. cs20 cs56
? 2007 microchip technology inc. ds70286a-page 293 dspic33fjxxxgpx06/x08/x10 table 24-34: dci module (multi-channel, i 2 s modes) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ (2) max units conditions cs10 t csckl csck input low time (csck pin is an input) t cy /2 + 20 ? ? ns ? csck output low time (3) (csck pin is an output) 30 ? ? ns ? cs11 t csckh csck input high time (csck pin is an input) t cy /2 + 20 ? ? ns ? csck output high time (3) (csck pin is an output) 30 ? ? ns ? cs20 t csckf csck output fall time (4) (csck pin is an output) ?1025ns ? cs21 t csckr csck output rise time (4) (csck pin is an output) ?1025ns ? cs30 t csdof csdo data output fall time (4) ?1025ns ? cs31 t csdor csdo data output rise time (4) ?1025ns ? cs35 t dv clock edge to csdo data valid ? ? 10 ns ? cs36 t div clock edge to csdo tri-stated 10 ? 20 ns ? cs40 t csdi setup time of csdi data input to csck edge (csck pin is input or output) 20 ? ? ns ? cs41 t hcsdi hold time of csdi data input to csck edge (csck pin is input or output) 20 ? ? ns ? cs50 t cofsf cofs fall time (cofs pin is output) ?1025ns note 1 cs51 t cofsr cofs rise time (cofs pin is output) ?1025ns note 1 cs55 t scofs setup time of cofs data input to csck edge (cofs pin is input) 20 ? ? ns ? cs56 t hcofs hold time of cofs data input to csck edge (cofs pin is input) 20 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typ? column is at 3.3v, 25c unless otherwise stated. parameters are for design guidance only and are not tested. 3: the minimum clock period for csck is 100 ns. therefore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all dci pins.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 294 ? 2007 microchip technology inc. figure 24-18: dci module (ac-link mode) timing characteristics sync bit_clk sdox sdix cs61 cs60 cs65 cs66 cs80 cs21 msb in cs75 lsb cs76 (cofs) (csck) lsb msb cs72 cs71 cs70 cs76 cs75 (csdo) (csdi) cs62 cs20 table 24-35: dci module (ac-li nk mode) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1,2) min typ (3) max units conditions cs60 t bclkl bit_clk low time 36 40.7 45 ns ? cs61 t bclkh bit_clk high time 36 40.7 45 ns ? cs62 t bclk bit_clk period ? 81.4 ? ns bit clock is input cs65 t sacl input setup time to falling edge of bit_clk ?? 10 ns ? cs66 t hacl input hold time from falling edge of bit_clk ?? 10 ns ? cs70 t synclo sync data output low time ? 19.5 ? s note 1 cs71 t synchi sync data output high time ? 1.3 ? s note 1 cs72 t sync sync data output period ? 20.8 ? s note 1 cs75 t racl rise time, sync, sdata_out ? 10 25 ns c load = 50 pf, v dd = 5v cs76 t facl fall time, sync, sdata_out ? 10 25 ns c load = 50 pf, v dd = 5v cs77 t racl rise time, sync, sdata_out ? ? 30 ns c load = 50 pf, v dd = 3v cs78 t facl fall time, sync, sdata_out ? ? 30 ns c load = 50 pf, v dd = 3v cs80 t ovdacl output valid delay from rising edge of bit_clk ?? 15 ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: these values assume bit_clk frequency is 12.288 mhz. 3: data in ?typ? column is at 3.3v, 25c unless otherwise stated. parameters are for design guidance only and are not tested.
? 2007 microchip technology inc. ds70286a-page 295 dspic33fjxxxgpx06/x08/x10 figure 24-19: can module i/o timing characteristics citx pin (output) ca10 ca11 old value new value ca20 cirx pin (input) table 24-36: can module i/o timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic (1) min typ max units conditions ca10 tiof port output fall time ? ? ? ns see parameter d032 ca11 tior port output rise time ? ? ? ns see parameter d031 ca20 tcwf pulse width to trigger can wake-up filter 120 ns ? note 1: these parameters are characterized but not tested in manufacturing.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 296 ? 2007 microchip technology inc. table 24-37: adc mo dule specifications ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ max. units conditions device supply ad01 av dd module v dd supply greater of v dd ? 0.3 or 3.0 ? lesser of v dd + 0.3 or 3.6 v? ad02 av ss module v ss supply v ss ? 0.3 ? v ss + 0.3 v ? reference inputs ad05 v refh reference voltage high av ss + 2.7 ? av dd vsee note 2 ad05a 3.0 ? 3.6 v v refh = av dd v refl = av ss = 0 ad06 v refl reference voltage low av ss ?av dd ? 2.7 v see note 2 ad06a 0 ? 0 v v refh = av dd v refl = av ss = 0 ad07 v ref absolute reference voltage 3.0 ? 3.6 v v ref = v refh - v refl ad08 i ref current drain ? 389 .001 549 1 a a adc operating adc off analog input ad12 v inh input voltage range v inh v inl ?v refh v this voltage reflects sample and hold channels 0, 1, 2, and 3 (ch0-ch3), positive input. see note 1 ad13 v inl input voltage range v inl v refl ?a vss + 1v v this voltage reflects sample and hold channels 0, 1, 2, and 3 (ch0-ch3), negative input. see note 1 ad17 r in recommended impedance of analog voltage source ??200 200 10-bit 12-bit note 1: the adc conversion result never decreases with an increase in the input voltage, and has no missing codes. 2: these parameters are not characterized or tested in manufacturing.
? 2007 microchip technology inc. ds70286a-page 297 dspic33fjxxxgpx06/x08/x10 table 24-38: adc module speci fications (12-bit mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ max. units conditions adc accuracy (12-bit mode) ? measurements with external v ref +/v ref - ad20a nr resolution 12 data bits bits ad21a inl integral nonlinearity -1 ? +1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad22a dnl differential nonlinearity >-1 ? <1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad23a g err gain error 1.25 1.5 3 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad24a e off offset error -2 -1.5 -1.25 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad25a ? monotonicity (1) ? ? ? ? guaranteed adc accuracy (12-bit mode) ? measurements with internal v ref +/v ref - ad20a nr resolution 12 data bits bits ad21a inl integral nonlinearity -1 ? +1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad22a dnl differential nonlinearity >-1 ? <1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad23a g err gain error 2 3 7 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad24a e off offset error 2 3 5 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad25a ? monotonicity (1) ? ? ? ? guaranteed dynamic performance (12-bit mode) ad30a thd total harmonic distortion -77 -69 -61 db ? ad31a sinad signal to noise and distortion 59 63 64 db ? ad32a sfdr spurious free dynamic range 63 72 79 db ? ad33a f nyq input signal bandwidth ? ? 250 khz ? ad34a enob effective number of bits 10.95 11.1 ? bits ? note 1: the adc conversion result never decreases with an increase in the input voltage, and has no missing codes.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 298 ? 2007 microchip technology inc. table 24-39: adc module speci fications (10-bit mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ max. units conditions adc accuracy (10-bit mode) ? measurements with external v ref +/v ref - ad20b nr resolution 10 data bits bits ad21b inl integral nonlinearity -1 ? +1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad22b dnl differential nonlinearity >-1 ? <1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad23b g err gain error 1 3 6 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad24b e off offset error 1 2 5 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad25b ? monotonicity (1) ? ? ? ? guaranteed adc accuracy (10-bit mode) ? measurements with internal v ref +/v ref - ad20b nr resolution 10 data bits bits ad21b inl integral nonlinearity -1 ? +1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad22b dnl differential nonlinearity >-1 ? <1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad23b g err gain error 1 5 6 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad24b e off offset error 1 2 3 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad25b ? monotonicity (1) ? ? ? ? guaranteed dynamic performance (10-bit mode) ad30b thd total harmonic distortion ? -64 -67 db ? ad31b sinad signal to noise and distortion ?5758db ? ad32b sfdr spurious free dynamic range ?6771db ? ad33b f nyq input signal bandwidth ? ? 550 khz ? ad34b enob effective number of bits 9.1 9.7 9.8 bits ? note 1: the adc conversion result never decreases with an increase in the input voltage, and has no missing codes.
? 2007 microchip technology inc. ds70286a-page 299 dspic33fjxxxgpx06/x08/x10 figure 24-20: adc conversion (12- bit mode) timing characteristics (asam = 0 , ssrc<2:0> = 000 ) ad55 t samp clear samp set samp ad61 adclk instruction samp ch0_dischrg ch0_samp ad60 conv adxif buffer( 0 ) 1 2 3 4 5 6 8 7 1 ? software sets adxcon. samp to start sampling. 2 ? sampling starts after discharge period. t samp is described 3 ? software clears adxcon. samp to start conversion. 4 ? sampling ends, conversion sequence starts. 5 ? convert bit 11. 9 ? one t ad for end of conversion. ad50 eoc 9 6 ? convert bit 10. 7 ? convert bit 1. 8 ? convert bit 0. execution in section 16. ?10/12-bit adc with dma? in the ?dspic33f family reference manual. ?
dspic33fjxxxgpx06/x08/x10 ds70286a-page 300 ? 2007 microchip technology inc. table 24-40: adc conversion (12-bi t mode) timing requirements) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic min. typ (1) max. units conditions clock parameters ad50a t ad adc clock period 117.6 ? ? ns ad51a t rc adc internal rc oscillator period ? 250 ? ns conversion rate ad55a t conv conversion time ? 14 t ad ns ad56a f cnv throughput rate ? ? 500 ksps ad57a t samp sample time 3 t ad ?? ? timing parameters ad60a t pcs conversion start from sample trigger (1) ?1.0 t ad ? ? auto-convert trigger (ssrc<2:0> = 111 ) not selected ad61a t pss sample start from setting sample (samp) bit (1) 0.5 t ad ? 1.5 t ad ?? ad62a t css conversion completion to sample start (asam = 1 ) (1) ?0.5 t ad ?? ? ad63a t dpu time to stabilize analog stage from adc off to adc on (1) 1?5 s? note 1: these parameters are characterized but not tested in manufacturing. 2: because the sample caps will eventually lose charge, clock rates below 10 khz can affect linearity performance, especially at elevated temperatures.
? 2007 microchip technology inc. ds70286a-page 301 dspic33fjxxxgpx06/x08/x10 figure 24-21: adc conversion (10- bit mode) timing characteristics (chps<1:0> = 01 , simsam = 0 , asam = 0 , ssrc<2:0> = 000 ) ad55 t samp clear samp set samp ad61 adclk instruction samp ch0_dischrg ch1_samp ad60 conv adxif buffer( 0 ) buffer( 1 ) 1 2 3 4 5 6 8 5 6 7 1 ? software sets adxcon. samp to start sampling. 2 ? sampling starts after discharge period. t samp is described in section 16. ?10/12-bit adc with dma? in the ?dspic33f 3 ? software clears adxcon. samp to start conversion. 4 ? sampling ends, conversion sequence starts. 5 ? convert bit 9. 8 ? one t ad for end of conversion. ad50 ch0_samp ch1_dischrg eoc 7 ad55 8 6 ? convert bit 8. 7 ? convert bit 0. execution family reference manual? .
dspic33fjxxxgpx06/x08/x10 ds70286a-page 302 ? 2007 microchip technology inc. figure 24-22: adc conversion (10-bit mode) timing characteristics (chps<1:0> = 01 , simsam = 0 , asam = 1 , ssrc<2:0> = 111 , samc<4:0> = 00001 ) ad55 t samp set adon adclk instruction samp ch0_dischrg ch1_samp conv adxif buffer( 0 ) buffer( 1 ) 1 2 3 4 5 6 4 5 6 8 1 ? software sets adxcon. adon to start ad operation. 2 ? sampling starts after discharge period. 3 ? convert bit 9. 4 ? convert bit 8. 5 ? convert bit 0. ad50 ch0_samp ch1_dischrg eoc 7 3 ad55 6 ? one t ad for end of conversion. 7 ? begin conversion of next channel. 8 ? sample for time specified by samc<4:0>. t samp t conv 3 4 execution t samp is described in section 16. ?10/12-bit adc with dma? in the ?dspic33f family reference manual? .
? 2007 microchip technology inc. ds70286a-page 303 dspic33fjxxxgpx06/x08/x10 table 24-41: adc conversion (10-bit mode) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c param no. symbol characteristic min. typ (1) max. units conditions clock parameters ad50b t ad adc clock period 65 ? ? ns ad51b t rc adc internal rc oscillator period ? 250 ? ns conversion rate ad55b t conv conversion time ? 12 t ad ?? ad56b f cnv throughput rate ? ? 1.1 msps ad57b t samp sample time 2 t ad ??? timing parameters ad60b t pcs conversion start from sample trigger (3) ?1.0 t ad ? ? auto-convert trigger (ssrc<2:0> = 111 ) not selected ad61b t pss sample start from setting sample (samp) bit (1) 0.5 t ad ? 1.5 t ad ?? ad62b t css conversion completion to sample start (asam = 1 ) (1) ?0.5 t ad ?? ? ad63b t dpu time to stabilize analog 1tage from adc off to adc on (1) 1?5 s? note 1: these parameters are characterized but not tested in manufacturing. 2: because the sample caps will eventually lose charge, clock rates below 10 khz can affect linearity performance, especially at elevated temperatures.
dspic33fjxxxgpx06/x08/x10 ds70286a-page 304 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 303 dspic33fjxxxgpx06/x08/x10 25.0 packaging information 25.1 package marking information 64-lead tqfp (10x10x1 mm) xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx yywwnnn example dspic33fj 256gp706 0510017 80-lead tqfp (12x12x1 mm) xxxxxxxxxxxx xxxxxxxxxxxx yywwnnn example dspic33fj128 0510017 legend: xx...x customer-specific information y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week ?01?) nnn alphanumeric traceability code pb-free jedec designator for matte tin (sn) * this package is pb-free. the pb-free jedec designator ( ) can be found on the outer packaging for this package. note : in the event the full microchip part number cannot be marked on one line, it will be carried over to the next line, thus limiting the number of available characters for customer-specific information. 3 e 3 e 100-lead tqfp (12x12x1 mm) xxxxxxxxxxxx xxxxxxxxxxxx yywwnnn example dspic33fj256 gp710-i/pt 0510017 gp708-i/pt 100-lead tqfp (14x14x1mm) xxxxxxxxxxxx xxxxxxxxxxxx yywwnnn 100-lead tqfp (14x14x1mm) dspic33fj256 gp710-i/pf 0510017 -i/pt 3 e 3 e 3 e 3 e
dspic33fjxxxgpx06/x08/x10 ds70286a-page 304 ? 2007 microchip technology inc. 25.2 package details 64-lead plastic thin quad flatpack (pt) ? 10x10x1 mm body, 2.00 mm footprint [tqfp] notes: 1. pin 1 visual index feature may vary, but must be located within the hatched area. 2. chamfers at corners are optional; size may vary. 3. dimensions d1 and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed 0.25 mm per side. 4. dimensioning and tolerancing per asme y14.5m. bsc: basic dimension. theoretically exact value shown without tolerances. ref: reference dimension, usually without tolerance, for information purposes only. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging units millimeters dimension limits min nom max number of leads n 64 lead pitch e 0.50 bsc overall height a ? ? 1.20 molded package thickness a2 0.95 1.00 1.05 standoff a1 0.05 ? 0.15 foot length l 0.45 0.60 0.75 footprint l1 1.00 ref foot angle 0 3.5 7 overall width e 12.00 bsc overall length d 12.00 bsc molded package width e1 10.00 bsc molded package length d1 10.00 bsc lead thickness c 0.09 ? 0.20 lead width b 0.17 0.22 0.27 mold draft angle top 11 12 13 mold draft angle bottom 11 12 13 d d1 e e1 e b n note 1 12 3 note 2 c l a1 l1 a2 a microchip technology drawing c04-085 b
? 2007 microchip technology inc. ds70286a-page 305 dspic33fjxxxgpx06/x08/x10 80-lead plastic thin quad flatpack (pt) ? 12x12x1 mm body, 2.00 mm footprint [tqfp] notes: 1. pin 1 visual index feature may vary, but must be located within the hatched area. 2. chamfers at corners are optional; size may vary. 3. dimensions d1 and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed 0.25 mm per side. 4. dimensioning and tolerancing per asme y14.5m. bsc: basic dimension. theoretically exact value shown without tolerances. ref: reference dimension, usually without tolerance, for information purposes only. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging units millimeters dimension limits min nom max number of leads n 80 lead pitch e 0.50 bsc overall height a ? ? 1.20 molded package thickness a2 0.95 1.00 1.05 standoff a1 0.05 ? 0.15 foot length l 0.45 0.60 0.75 footprint l1 1.00 ref foot angle 0 3.5 7 overall width e 14.00 bsc overall length d 14.00 bsc molded package width e1 12.00 bsc molded package length d1 12.00 bsc lead thickness c 0.09 ? 0.20 lead width b 0.17 0.22 0.27 mold draft angle top 11 12 13 mold draft angle bottom 11 12 13 d d1 e e1 e b n note 1 12 3 note 2 a a2 l1 a1 l c microchip technology drawing c04-092 b
dspic33fjxxxgpx06/x08/x10 ds70286a-page 306 ? 2007 microchip technology inc. 100-lead plastic thin quad flatpack (pt) ? 12x12x1 mm body, 2.00 mm footprint [tqfp] notes: 1. pin 1 visual index feature may vary, but must be located within the hatched area. 2. chamfers at corners are optional; size may vary. 3. dimensions d1 and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed 0.25 mm per side. 4. dimensioning and tolerancing per asme y14.5m. bsc: basic dimension. theoretically exact value shown without tolerances. ref: reference dimension, usually without tolerance, for information purposes only. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging units millimeters dimension limits min nom max number of leads n 100 lead pitch e 0.40 bsc overall height a ? ? 1.20 molded package thickness a2 0.95 1.00 1.05 standoff a1 0.05 ? 0.15 foot length l 0.45 0.60 0.75 footprint l1 1.00 ref foot angle 0 3.5 7 overall width e 14.00 bsc overall length d 14.00 bsc molded package width e1 12.00 bsc molded package length d1 12.00 bsc lead thickness c 0.09 ? 0.20 lead width b 0.13 0.18 0.23 mold draft angle top 11 12 13 mold draft angle bottom 11 12 13 d d1 e e1 e b n 12 3 note 1 note 2 c l a1 l1 a a2 microchip technology drawing c04-100 b
? 2007 microchip technology inc. ds70286a-page 307 dspic33fjxxxgpx06/x08/x10 100-lead plastic thin quad flatpack (pf) ? 14x14x1 mm body, 2.00 mm footprint [tqfp] notes: 1. pin 1 visual index feature may vary, but must be located within the hatched area. 2. chamfers at corners are optional; size may vary. 3. dimensions d1 and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed 0.25 mm per side. 4. dimensioning and tolerancing per asme y14.5m. bsc: basic dimension. theoretically exact value shown without tolerances. ref: reference dimension, usually without tolerance, for information purposes only. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging units millimeters dimension limits min nom max number of leads n 100 lead pitch e 0.50 bsc overall height a ? ? 1.20 molded package thickness a2 0.95 1.00 1.05 standoff a1 0.05 ? 0.15 foot length l 0.45 0.60 0.75 footprint l1 1.00 ref foot angle 0 3.5 7 overall width e 16.00 bsc overall length d 16.00 bsc molded package width e1 14.00 bsc molded package length d1 14.00 bsc lead thickness c 0.09 ? 0.20 lead width b 0.17 0.22 0.27 mold draft angle top 11 12 13 mold draft angle bottom 11 12 13 d d1 e b e1 e n note 1 note 2 12 3 c l a1 l1 a2 a microchip technology drawing c04-110 b
dspic33fjxxxgpx06/x08/x10 ds70286a-page 308 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 309 dspic33fjxxxgpx06/x08/x10 appendix a: differences between ?ps? (prototype sample) devices and final production devices the dspic33fjxxxgpx06/x08/x10 devices marked ?ps? have some key differences from the final produc- tion devices (devices not marked ?ps?). the major dif- ferences are listed in this appendix. in addition, there are minor differences in several sfr names, bits and reset states, which are described in section 3.0 ?memory organization? and the corresponding peripheral sections. a.1 device names the prototype sample devices have a suffix ?ps? in their names, as marked on the device package. this distinguishes them from engineering sample devices (which are suffixed ?es?) and final production devices (that have neither a ?ps? nor an ?es? suffix on the device package marking). prototype samples are available only for a subset of the final production devices. please refer to the device tables in this data sheet for a listing of all devices. a.2 ram sizes the total ram size, including the size of the dual ported dma ram, is different between each ?ps? device and the corresponding final production device. for exam- ple, the final production devices have 2 kbytes dma ram, whereas the ?ps? devices have 1 kbyte dma ram. please refer to the device tables in this data sheet for the memory sizes of each dspic33fjxxxgpx06/x08/x10 device. a.3 interrupts the final production devices have four more interrupt sources (vectors) than the ?ps? devices do. also, two of the interrupt vectors are associated with slightly dif- ferent events from the corresponding interrupts in the ?ps? devices. please refer to section 6.0 ?interrupt controller? for more details. a.4 dma enhancements both ?ps? and final production devices can perform direct memory access (dma) data transfers. in addition to all of the features supported by the dma controller in the ?ps? devices, the dma controller in the final production devices also supports the peripheral indirect addressing mode. please refer to section 7.0 ?direct memory access (dma)? for a description of this feature. a.5 oscillator operation the default values of the pll postscaler and feedback divisor bits are different between the ?ps? devices and final production devices. please refer to section 8.0 ?oscillator configuration? for the register definitions and reset states. a.6 can and enhanced can the dspic33fjxxxgpx06/x08/x10 devices marked ?ps? have up to two can modules. the functionality and register layout of these modules are identical to those of dspic30f devices, and are described in section 18.0 ?enhanced can (ecan?) module? of this data sheet. these modules do not provide dma support. the final production devices have up to two enhanced can (ecan? technology) modules. these modules have significantly more features than the can mod- ules, mainly in the form of an increased number of available buffers, filters and masks, as well as dma support. a.7 adc differences both ?ps? and final production devices contain up to two adc modules. the ?ps? devices have a 16-word deep adc result buffer. the final production devices have enhanced dma sup- port in the form of additional dma ram and peripheral indirect addressing. this renders the 16-word adc buffer redundant. hence, the buffer has been replaced by a single adc result register. a.8 device packages the final production devices are offered in the following tqfp packages: ? 64-pin tqfp 10x10x1 mm ? 80-pin tqfp 12x12x1 mm ? 100-pin tqfp 12x12x1 mm ? 100-pin tqfp 14x14x1 mm the ?ps? devices are offered in the following tqfp packages: ? 64-pin tqfp 10x10x1 mm ? 80-pin tqfp 12x12x1 mm ? 100-pin tqfp 14x14x1 mm
dspic33fjxxxgpx06/x08/x10 ds70286a-page 310 ? 2007 microchip technology inc. appendix b: revision history revision a (may 2007) initial release of this document.
? 2007 microchip technology inc. ds70286a-page 311 dspic33fjxxxgpx06/x08/x10 index a a/d converter ................................................................... 231 dma .......................................................................... 231 initialization ............................................................... 231 key features............................................................. 231 ac characteristics ............................................................ 273 internal rc accuracy ................................................ 275 load conditions ........................................................ 273 ac-link mode operation .................................................. 224 16-bit mode ............................................................... 224 20-bit mode ............................................................... 225 adc module adc11 register map .................................................. 45 adc2 register map .................................................... 45 alternate vector table (aivt)............................................. 79 arithmetic logic unit (alu)................................................. 23 assembler mpasm assembler................................................... 262 automatic clock stretch.................................................... 171 receive mode ........................................................... 171 transmit mode .......................................................... 171 b barrel shifter ....................................................................... 27 bit-reversed addressing .................................................... 60 example ...................................................................... 61 implementation ........................................................... 60 sequence table (16-entry)......................................... 61 block diagrams 16-bit timer1 module ................................................ 147 a/d module ....................................................... 232, 233 connections for on-chip voltage regulator............. 249 dci module ............................................................... 218 device clock ..................................................... 135, 137 dsp engine ................................................................ 24 dspic33f .................................................................... 14 dspic33f cpu core................................................... 18 ecan module ........................................................... 188 input capture ............................................................ 155 output compare ....................................................... 159 pll............................................................................ 137 reset system.............................................................. 73 shared port structure ............................................... 145 spi ............................................................................ 162 timer2 (16-bit) .......................................................... 151 timer2/3 (32-bit) ....................................................... 150 uart ........................................................................ 179 watchdog timer (wdt) ............................................ 250 c c compilers mplab c18 .............................................................. 262 mplab c30 .............................................................. 262 clock switching................................................................. 142 enabling .................................................................... 142 sequence.................................................................. 142 code examples erasing a program memory page............................... 71 initiating a programming sequence............................ 72 loading write buffers ................................................. 72 port write/read ........................................................ 146 pwrsav instruction syntax..................................... 143 code protection ........................................................ 245, 251 configuration bits ............................................................. 245 description (table) ................................................... 246 configuration register map .............................................. 245 configuring analog port pins............................................ 146 cpu control register.......................................................... 20 cpu clocking system ...................................................... 136 options ..................................................................... 136 selection................................................................... 136 customer change notification service............................. 317 customer notification service .......................................... 317 customer support............................................................. 317 d data accumulators and adder/subtractor .......................... 25 data space write saturation ...................................... 27 overflow and saturation ............................................. 25 round logic ............................................................... 26 write back .................................................................. 26 data address space........................................................... 32 alignment.................................................................... 32 memory map for dspic33f devices with 16 kbs ram ....................................................... 34 memory map for dspic33f devices with 30 kbs ram ....................................................... 35 memory map for dspic33f devices with 8 kbs ram ......................................................... 33 near data space ........................................................ 32 software stack ........................................................... 57 width .......................................................................... 32 data converter interface (dci) module ............................ 217 dc characteristics............................................................ 266 i/o pin input specifications ...................................... 270 i/o pin output specifications.................................... 271 idle current (i doze ) .................................................. 269 idle current (i idle ) .................................................... 268 operating current (i dd ) ............................................ 267 power-down current (i pd )........................................ 268 program memory...................................................... 272 temperature and voltage specifications.................. 266 dci bit clock generator .................................................. 221 buffer alignment with data frames.......................... 223 buffer control ........................................................... 217 buffer data alignment .............................................. 217 buffer length control ............................................... 222 csdo mode bit ........................................................ 224 data justification control bit .................................... 222 device frequencies for common codec csck frequencies (table) ......................................... 221 digital loopback mode ............................................. 224 frame sync generator ............................................. 219 frame sync mode control bits................................. 219 interrupts .................................................................. 224 introduction............................................................... 217 master frame sync operation ................................. 219 module enable.......................................................... 219 operation.................................................................. 219 operation during cpu idle mode ............................. 224 operation during cpu sleep mode ......................... 224 receive slot enable bits .......................................... 222 receive status bits .................................................. 223 sample clock edge control bit ................................ 222 slave frame sync operation ................................... 220
dspic33fjxxxgpx06/x08/x10 ds70286a-page 312 ? 2007 microchip technology inc. slot enable bits operation with frame sync ............ 222 slot status bits.......................................................... 224 synchronous data transfers .................................... 222 transmit slot enable bits.......................................... 222 transmit status bits.................................................. 223 transmit/receive shift register ............................... 217 underflow mode control bit ...................................... 224 word size selection bits........................................... 219 dci i/o pins ...................................................................... 217 cofs ........................................................................ 217 csck ........................................................................ 217 csdi ......................................................................... 217 csdo........................................................................ 217 dci module register map............................................................... 54 development support ....................................................... 261 differences between "ps" and final production devices ..................................................................... 309 dma module dma register map...................................................... 46 dmac registers ............................................................... 126 dmaxcnt ................................................................. 126 dmaxcon ................................................................ 126 dmaxpad ................................................................. 126 dmaxreq ................................................................ 126 dmaxsta ................................................................. 126 dmaxstb ................................................................. 126 dsp engine......................................................................... 23 multiplier...................................................................... 25 e ecan module baud rate setting..................................................... 192 ecan1 register map (c1ctrl1.win = 0 or 1) ......... 48 ecan1 register map (c1ctrl1.win = 0) ................ 48 ecan1 register map (c1ctrl1.win = 1) ................ 49 ecan2 register map (c2ctrl1.win = 0 or 1) ......... 51 ecan2 register map (c2ctrl1.win = 0) .......... 51, 52 frame types............................................................. 187 message reception .................................................. 189 message transmission ............................................. 191 modes of operation .................................................. 189 overview ................................................................... 187 electrical characteristics................................................... 265 ac ............................................................................. 273 enhanced can module..................................................... 187 equations a/d conversion clock period ................................... 234 bit clock frequency .................................................. 221 calculating the pwm period ..................................... 158 calculation for maximum pwm resolution............... 158 cofsg period .......................................................... 219 device operating frequency .................................... 136 relationship between device and spi clock speed...................................................... 164 serial clock rate ...................................................... 169 time quantum for clock generation ........................ 193 uart baud rate with brgh = 0 ............................. 180 uart baud rate with brgh = 1 ............................. 180 errata .................................................................................. 12 f flash program memory ...................................................... 67 control registers ........................................................ 68 operations .................................................................. 68 programming algorithm .............................................. 71 rtsp operation ......................................................... 68 table instructions ....................................................... 67 flexible configuration ....................................................... 245 fscm delay for crystal and pll clock sources................... 77 device resets............................................................. 77 i i/o ports............................................................................ 145 parallel i/o (pio) ...................................................... 145 write/read timing .................................................... 146 i 2 c addresses................................................................. 171 baud rate generator ............................................... 169 general call address support .................................. 171 interrupts .................................................................. 169 ipmi support............................................................. 171 master mode operation clock arbitration ............................................... 172 multi-master communication, bus collision and bus arbitration ................................... 172 operating modes ...................................................... 169 registers .................................................................. 169 slave address masking ............................................ 171 slope control ............................................................ 172 software controlled clock stretching (stren = 1) . 171 i 2 c module i2c1 register map...................................................... 43 i2c2 register map...................................................... 43 i 2 s mode operation .......................................................... 225 data justification ...................................................... 225 frame and data word length selection .................. 225 in-circuit debugger........................................................... 251 in-circuit emulation .......................................................... 245 in-circuit serial programming (icsp)....................... 245, 251 infrared support built-in irda encoder and decoder........................... 181 external irda, irda clock output ............................. 181 input capture registers .................................................................. 156 input change notification module..................................... 146 instruction addressing modes ............................................ 57 file register instructions ............................................ 57 fundamental modes supported ................................. 58 mac instructions ........................................................ 58 mcu instructions ........................................................ 57 move and accumulator instructions............................ 58 other instructions ....................................................... 58 instruction set overview................................................................... 256 summary .................................................................. 253 instruction-based power-saving modes........................... 143 idle ............................................................................ 144 sleep ........................................................................ 143 internal rc oscillator use with wdt........................................................... 250 internet address ............................................................... 317
? 2007 microchip technology inc. ds70286a-page 313 dspic33fjxxxgpx06/x08/x10 interrupt control and status registers................................ 83 iecx ............................................................................ 83 ifsx............................................................................. 83 intcon1 .................................................................... 83 intcon2 .................................................................... 83 ipcx ............................................................................ 83 interrupt setup procedures ............................................... 123 initialization ............................................................... 123 interrupt disable........................................................ 123 interrupt service routine .......................................... 123 trap service routine ................................................ 123 interrupt vector table (ivt) ................................................ 79 interrupts coincident with power save instructions.......... 144 j jtag boundary scan interface ........................................ 245 m memory organization.......................................................... 29 microchip internet web site .............................................. 317 modes of operation disable ...................................................................... 189 initialization ............................................................... 189 listen all messages .................................................. 189 listen only ................................................................ 189 loopback .................................................................. 189 normal operation...................................................... 189 modulo addressing ............................................................. 58 applicability ................................................................. 60 operation example ..................................................... 59 start and end address................................................ 59 w address register selection .................................... 59 mplab asm30 assembler, linker, librarian ................... 262 mplab icd 2 in-circuit debugger ................................... 263 mplab ice 2000 high-performance universal in-circuit emulator .................................................... 263 mplab integrated development environment software.................................................................... 261 mplab pm3 device programmer .................................... 263 mplab real ice in-circuit emulator system................. 263 mplink object linker/mplib object librarian ................ 262 n nvm module register map............................................................... 56 o open-drain configuration ................................................. 146 output compare ............................................................... 157 registers................................................................... 160 p packaging ......................................................................... 303 details ....................................................................... 304 marking ..................................................................... 303 peripheral module disable (pmd) .................................... 144 picstart plus development programmer ..................... 264 pinout i/o descriptions (table) ............................................ 15 pmd module register map............................................................... 56 por and long oscillator start-up times............................ 77 porta register map .............................................................. 54 portb register map .............................................................. 54 portc register map .............................................................. 55 portd register map .............................................................. 55 porte register map .............................................................. 55 portf register map .............................................................. 55 portg register map .............................................................. 56 power-saving features .................................................... 143 clock frequency and switching ............................... 143 program address space..................................................... 29 construction ............................................................... 62 data access from program memory using program space visibility..................................... 65 data access from program memory using table instructions ......................................................... 64 data access from, address generation ..................... 63 memory map............................................................... 30 table read instructions tblrdh ............................................................. 64 tblrdl.............................................................. 64 visibility operation...................................................... 65 program memory interrupt vector........................................................... 31 organization ............................................................... 31 reset vector............................................................... 31 pulse-width modulation mode.......................................... 158 pwm duty cycle ................................................................ 158 period ....................................................................... 158 r reader response............................................................. 318 registers adxchs0 (adcx input channel 0 select ................ 241 adxchs123 (adcx input channel 1, 2, 3 select) ... 240 adxcon1 (adcx control 1) .................................... 235 adxcon2 (adcx control 2) .................................... 237 adxcon3 (adcx control 3) .................................... 238 adxcon4 (adcx control 4) .................................... 239 adxcssh (adcx input scan select high) .............. 242 adxcssl (adcx input scan select low)................ 242 adxpcfgh (adcx port configuration high) ........... 243 adxpcfgl (adcx port configuration low) ............ 243 cibufpnt1 (ecan filter 0-3 buffer pointer) .......... 204 cibufpnt2 (ecan filter 4-7 buffer pointer) .......... 205 cibufpnt3 (ecan filter 8-11 buffer pointer) ........ 205 cibufpnt4 (ecan filter 12-15 buffer pointer) ...... 206 cicfg1 (ecan baud rate configuration 1)............ 202 cicfg2 (ecan baud rate configuration 2)............ 203 cictrl1 (ecan control 1)...................................... 194 cictrl2 (ecan control 2)...................................... 195 ciec (ecan transmit/receive error count) ........... 201 cifctrl (ecan fifo control) ............................... 197 cifen1 (ecan acceptance filter enable)............... 204 cififo (ecan fifo status) .................................... 198 cifmsksel1 (ecan filter 7-0 mask selection) ..... 208 ciinte (ecan interrupt enable) .............................. 200 ciintf (ecan interrupt flag) .................................. 199
dspic33fjxxxgpx06/x08/x10 ds70286a-page 314 ? 2007 microchip technology inc. cirxfneid (ecan acceptance filter n extended identifier) ........................................................... 207 cirxfnsid (ecan acceptance filter n standard identifier) ........................................................... 207 cirxful1 (ecan receive buffer full 1) ................. 210 cirxful2 (ecan receive buffer full 2) ................. 210 cirxmneid (ecan acceptance filter mask n extended identifier)........................................... 209 cirxmnsid (ecan acceptance filter mask n standard identifier) ........................................... 209 cirxovf1 (ecan receive buffer overflow 1) ........ 211 cirxovf2 (ecan receive buffer overflow 2) ........ 211 citrbndlc (ecan buffer n data length control) .. 214 citrbndm (ecan buffer n data field byte m) ....... 214 citrbneid (ecan buffer n extended identifier) ..... 213 citrbnsid (ecan buffer n standard identifier) ...... 213 citrbnstat (ecan receive buffer n status) ........ 215 citrmncon (ecan tx/rx buffer m control)......... 212 civec (ecan interrupt code) .................................. 196 clkdiv (clock divisor)............................................. 139 corcon (core control) ...................................... 22, 84 dcicon1 (dci control 1)......................................... 226 dcicon2 (dci control 2)......................................... 227 dcicon3 (dci control 3)......................................... 228 dcistat (dci status).............................................. 229 dmacs0 (dma controller status 0)......................... 131 dmacs1 (dma controller status 1)......................... 133 dmaxcnt (dma channel x transfer count) ........... 130 dmaxcon (dma channel x control) ....................... 127 dmaxpad (dma channel x peripheral address)..... 130 dmaxreq (dma channel x irq select) ................. 128 dmaxsta (dma channel x ram start address a).. 129 dmaxstb (dma channel x ram start address b).. 129 dsadr (most recent dma ram address).............. 134 i2cxcon (i2cx control) ........................................... 173 i2cxmsk (i2cx slave mode address mask) ............ 177 i2cxstat (i2cx status) ........................................... 175 icxcon (input capture x control) ............................ 156 iec0 (interrupt enable control 0) ............................... 96 iec1 (interrupt enable control 1) ............................... 98 iec2 (interrupt enable control 2) ............................. 100 iec3 (interrupt enable control 3) ............................. 102 iec4 (interrupt enable control 4) ............................. 103 ifs0 (interrupt flag status 0) ..................................... 88 ifs1 (interrupt flag status 1) ..................................... 90 ifs2 (interrupt flag status 2) ..................................... 92 ifs3 (interrupt flag status 3) ..................................... 94 ifs4 (interrupt flag status 4) ..................................... 95 intcon1 (interrupt control 1).................................... 85 intcon2 (interrupt control 2).................................... 87 inttreg interrupt control and status register....... 122 ipc0 (interrupt priority control 0) ............................. 104 ipc1 (interrupt priority control 1) ............................. 105 ipc10 (interrupt priority control 10) ......................... 114 ipc11 (interrupt priority control 11) ......................... 115 ipc12 (interrupt priority control 12) ......................... 116 ipc13 (interrupt priority control 13) ......................... 117 ipc14 (interrupt priority control 14) ......................... 118 ipc15 (interrupt priority control 15) ......................... 119 ipc16 (interrupt priority control 16) ......................... 120 ipc17 (interrupt priority control 17) ......................... 121 ipc2 (interrupt priority control 2) ............................. 106 ipc3 (interrupt priority control 3) ............................. 107 ipc4 (interrupt priority control 4) ............................. 108 ipc5 (interrupt priority control 5) ............................. 109 ipc6 (interrupt priority control 6) ............................. 110 ipc7 (interrupt priority control 7) ............................. 111 ipc8 (interrupt priority control 8) ............................. 112 ipc9 (interrupt priority control 9) ............................. 113 nvmcom (flash memory control)....................... 69, 70 ocxcon (output compare x control) ..................... 160 osccon (oscillator control) ................................... 138 osctun (frc oscillator tuning)............................ 141 pllfbd (pll feedback divisor).............................. 140 rcon (reset control)................................................ 74 rscon (dci receive slot control) ......................... 230 spixcon1 (spix control 1)...................................... 166 spixcon2 (spix control 2)...................................... 167 spixstat (spix status and control) ....................... 165 sr (cpu status)................................................... 20, 84 t1con (timer1 control) .......................................... 148 tscon (dci transmit slot control)......................... 230 txcon (t2con, t4con, t6con or t8con control)............................................................. 152 tycon (t3con, t5con, t7con or t9con control)............................................................. 153 uxmode (uartx mode).......................................... 182 uxsta (uartx status and control)......................... 184 reset clock source selection............................................... 76 special function register reset states ..................... 78 times .......................................................................... 76 reset sequence ................................................................. 79 resets................................................................................. 73 s serial peripheral interface (spi) ....................................... 161 setup for continuous output pulse generation ............... 157 setup for single output pulse generation........................ 157 software simulator (mplab sim) .................................... 262 software stack pointer, frame pointer calll stack frame ................................................... 57 special features of the cpu ............................................ 245 spi master, frame master connection ........................... 163 master/slave connection.......................................... 163 slave, frame master connection ............................. 164 slave, frame slave connection ............................... 164 spi module spi1 register map...................................................... 44 spi2 register map...................................................... 44 symbols used in opcode descriptions ............................ 254 system control register map .............................................................. 56 t temperature and voltage specifications ac............................................................................. 273 timer1............................................................................... 147 timer2/3, timer4/5, timer6/7 and timer8/9 ..................... 149 timing characteristics clko and i/o ........................................................... 276 timing diagrams 10-bit a/d conversion (chps = 01, simsam = 0, asam = 0, ssrc = 000) .................................. 299 10-bit a/d conversion (chps = 01, simsam = 0, asam = 1, ssrc = 111, samc = 00001)........ 300 12-bit a/d conversion (asam = 0, ssrc = 000)..... 298 can i/o .................................................................... 295 dci ac-link mode.................................................... 294 dci multi -channel, i 2 s modes................................. 292
? 2007 microchip technology inc. ds70286a-page 315 dspic33fjxxxgpx06/x08/x10 ecan bit................................................................... 192 external clock........................................................... 274 frame sync, ac-link start-of-frame ....................... 220 frame sync, multi-channel mode ............................ 220 i2cx bus data (master mode) .................................. 288 i2cx bus data (slave mode) .................................... 290 i2cx bus start/stop bits (master mode) ................... 288 i2cx bus start/stop bits (slave mode) ..................... 290 i 2 s interface frame sync.......................................... 220 input capture (capx)................................................ 281 oc/pwm................................................................... 282 output compare (ocx)............................................. 281 reset, watchdog timer, oscillator start-up timer and power-up timer ............................... 277 spix master mode (cke = 0) ................................... 283 spix master mode (cke = 1) ................................... 284 spix slave mode (cke = 0) ..................................... 285 spix slave mode (cke = 1) ..................................... 286 timer1, 2, 3, 4, 5, 6, 7, 8, 9 external clock............... 279 timing requirements clko and i/o ........................................................... 276 dci ac-link mode .................................................... 294 dci multi-channel, i 2 s modes.................................. 293 external clock........................................................... 274 input capture ............................................................ 281 timing specifications 10-bit a/d conversion requirements ....................... 301 12-bit a/d conversion requirements ....................... 298 can i/o requirements ............................................. 295 i2cx bus data requirements (master mode) ........... 289 i2cx bus data requirements (slave mode) ............. 291 output compare requirements ................................ 281 pll clock.................................................................. 275 reset, watchdog timer, oscillator start-up timer, power-up timer and brown-out reset requirements ................................................... 278 simple oc/pwm mode requirements ..................... 282 spix master mode (cke = 0) requirements ............ 283 spix master mode (cke = 1) requirements ............ 284 spix slave mode (cke = 0) requirements .............. 285 spix slave mode (cke = 1) requirements .............. 286 timer1 external clock requirements ....................... 279 timer2, timer4, timer6 and timer8 external clock requirements ......................................... 280 timer3, timer5, timer7 and timer9 external clock requirements ......................................... 280 u uart baud rate generator (brg) .............................................. 180 break and sync transmit sequence ........................ 181 flow control using uxcts and uxrts pins ........... 181 receiving in 8-bit or 9-bit data mode ....................... 181 transmitting in 8-bit data mode ............................... 181 transmitting in 9-bit data mode ............................... 181 uart module uart1 register map ................................................. 44 uart2 register map ................................................. 44 v voltage regulator (on-chip) ............................................ 249 w watchdog timer (wdt)............................................ 245, 250 programming considerations ................................... 250 www address ................................................................. 317 www, on-line support ................... .................................. 12
dspic33fjxxxgpx06/x08/x10 ds70286a-page 316 ? 2007 microchip technology inc. notes:
? 2007 microchip technology inc. ds70286a-page 317 dspic33fjxxxgpx06/x08/x10 the microchip web site microchip provides online support via our www site at www.microchip.com. this web site is used as a means to make files and information easily available to customers. accessible by using your favorite internet browser, the web site contains the following informa- tion: ? product support ? data sheets and errata, appli- cation notes and sample programs, design resources, user?s guides and hardware support documents, latest software releases and archived software ? general technical support ? frequently asked questions (faq), technical support requests, online discussion groups, microchip consultant program member listing ? business of microchip ? product selector and ordering guides, latest microchip press releases, listing of seminars and events, listings of micro- chip sales offices, distributors and factory repre- sentatives customer change notification service microchip?s customer notification service helps keep customers current on microchip products. subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a spec- ified product family or development tool of interest. to register, access the microchip web site at www.microchip.com, click on customer change notifi- cation and follow the registration instructions. customer support users of microchip products can receive assistance through several channels: ? distributor or representative ? local sales office ? field application engineer (fae) ? technical support customers should contact their distributor, representa- tive or field application engineer (fae) for support. local sales offices are also available to help custom- ers. a listing of sales offices and locations is included in the back of this document. technical support is available through the web site at: http://support.microchip.com
dspic33fjxxxgpx06/x08/x10 ds70286a-page 318 ? 2007 microchip technology inc. reader response it is our intention to provide you with the best documentation possible to ensure successful use of your microchip prod- uct. if you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation can better serve you, please fax your comments to the technical publications manager at (480) 792-4150. please list the following information, and use this outline to provide us with your comments about this document. to : technical publications manager re: reader response total pages sent ________ from: name company address city / state / zip / country telephone: (_______) _________ - _________ application (optional): would you like a reply? y n device: literature number: questions: fax: (______) _________ - _________ ds70286a dspic33fjxxxgpx06/x08/ 1. what are the best features of this document? 2. how does this document meet your hardware and software development needs? 3. do you find the organization of this document easy to follow? if not, why? 4. what additions to the document do you think would enhance the structure and subject? 5. what deletions from the document could be made without affecting the overall usefulness? 6. is there any incorrect or misleading information (what and where)? 7. how would you improve this document?
? 2007 microchip technology inc. ds70286a-page 319 dspic33fjxxxgpx06/x08/x10 product identification system to order or obtain information, e. g., on pricing or delivery, refer to the factory or the listed sales office . architecture: 33 = 16-bit digital signal controller flash memory family: fj = flash program memory, 3.3v product group: gp2 = general purpose family gp3 = general purpose family gp5 = general purpose family gp7 = general purpose family pin count: 06 = 64-pin 08 = 80-pin 10 = 100-pin temperature range: i = -40 c to +85 c (industrial) package: pt = 10x10 or 12x12 mmtqfp (thin quad flat- pack) pf = 14x14 mmtqfp (thin quad flatpack) pattern three-digit qtp, sqtp, code or special requirements (blank otherwise) examples: a) dspic33fj256gp710i/pt: general-purpose dspic33, 64 kb program memory, 100-pin, industrial temp., tqfp package. microchip trademark architecture flash memory family program memory size (kb) product group pin count temperature range package pattern dspic 33 fj 256 gp7 10 t i / pt - xxx tape and reel flag (if applicable)
ds70286a-page 320 ? 2007 microchip technology inc. americas corporate office 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7200 fax: 480-792-7277 technical support: http://support.microchip.com web address: www.microchip.com atlanta duluth, ga tel: 678-957-9614 fax: 678-957-1455 boston westborough, ma tel: 774-760-0087 fax: 774-760-0088 chicago itasca, il tel: 630-285-0071 fax: 630-285-0075 dallas addison, tx tel: 972-818-7423 fax: 972-818-2924 detroit farmington hills, mi tel: 248-538-2250 fax: 248-538-2260 kokomo kokomo, in tel: 765-864-8360 fax: 765-864-8387 los angeles mission viejo, ca tel: 949-462-9523 fax: 949-462-9608 santa clara santa clara, ca tel: 408-961-6444 fax: 408-961-6445 toronto mississauga, ontario, canada tel: 905-673-0699 fax: 905-673-6509 asia/pacific asia pacific office suites 3707-14, 37th floor tower 6, the gateway habour city, kowloon hong kong tel: 852-2401-1200 fax: 852-2401-3431 australia - sydney tel: 61-2-9868-6733 fax: 61-2-9868-6755 china - beijing tel: 86-10-8528-2100 fax: 86-10-8528-2104 china - chengdu tel: 86-28-8665-5511 fax: 86-28-8665-7889 china - fuzhou tel: 86-591-8750-3506 fax: 86-591-8750-3521 china - hong kong sar tel: 852-2401-1200 fax: 852-2401-3431 china - qingdao tel: 86-532-8502-7355 fax: 86-532-8502-7205 china - shanghai tel: 86-21-5407-5533 fax: 86-21-5407-5066 china - shenyang tel: 86-24-2334-2829 fax: 86-24-2334-2393 china - shenzhen tel: 86-755-8203-2660 fax: 86-755-8203-1760 china - shunde tel: 86-757-2839-5507 fax: 86-757-2839-5571 china - wuhan tel: 86-27-5980-5300 fax: 86-27-5980-5118 china - xian tel: 86-29-8833-7250 fax: 86-29-8833-7256 asia/pacific india - bangalore tel: 91-80-4182-8400 fax: 91-80-4182-8422 india - new delhi tel: 91-11-4160-8631 fax: 91-11-4160-8632 india - pune tel: 91-20-2566-1512 fax: 91-20-2566-1513 japan - yokohama tel: 81-45-471- 6166 fax: 81-45-471-6122 korea - gumi tel: 82-54-473-4301 fax: 82-54-473-4302 korea - seoul tel: 82-2-554-7200 fax: 82-2-558-5932 or 82-2-558-5934 malaysia - penang tel: 60-4-646-8870 fax: 60-4-646-5086 philippines - manila tel: 63-2-634-9065 fax: 63-2-634-9069 singapore tel: 65-6334-8870 fax: 65-6334-8850 taiwan - hsin chu tel: 886-3-572-9526 fax: 886-3-572-6459 taiwan - kaohsiung tel: 886-7-536-4818 fax: 886-7-536-4803 taiwan - taipei tel: 886-2-2500-6610 fax: 886-2-2508-0102 thailand - bangkok tel: 66-2-694-1351 fax: 66-2-694-1350 europe austria - wels tel: 43-7242-2244-39 fax: 43-7242-2244-393 denmark - copenhagen tel: 45-4450-2828 fax: 45-4485-2829 france - paris tel: 33-1-69-53-63-20 fax: 33-1-69-30-90-79 germany - munich tel: 49-89-627-144-0 fax: 49-89-627-144-44 italy - milan tel: 39-0331-742611 fax: 39-0331-466781 netherlands - drunen tel: 31-416-690399 fax: 31-416-690340 spain - madrid tel: 34-91-708-08-90 fax: 34-91-708-08-91 uk - wokingham tel: 44-118-921-5869 fax: 44-118-921-5820 w orldwide s ales and s ervice 12/08/06


▲Up To Search▲   

 
Price & Availability of DSPIC33FJ256GP510IPF-XXX

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X